Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Improved Player Movement

Summary

I frustratingly spent over two hours tonight trying to figure out how to get Unity Remote 5 working on my end, but realized too deep in that the new Unity input system is actually not yet supported on Unity Remote 5 as called out in this forum post I came across. Since I realized this wasn't possible I decided to focus on trying to improve the core movement of the player while working with the player touch inputs.

I was actually able to get this working pretty well, but had to do some funky maneuvering on the backend. Instead of now moving the player when you click, I have it set to move an empty object when you click, and have a simple script that then moves the player sprite towards to empty object. To then have this empty object move back to the center I have an empty object that sits on the bottom of the screen where the empty player object will always move towards. Essentially I have three objects (one being the player sprite and two empty sprites) that are all interacting together in order to get the player touch and movements to work together.

Something that I did need to build out though is a coroutine that will wait for a half of a second after the player clicks somewhere so the player sprite can make it to the input location. Previously the player sprite would never even make it close to the input location.

Weird Bug

I noticed for some reason on the first input touch event the location is always (0,0) in the game world. I don't know why this is, but will definitely want to try and address this in a future update as it gets a bit annoying and I could see this really frustrating players.

What I Want to Add

I got the movement and input controls to work well, but I think it would really sell the experience if I can get the player sprite to rotate on a pivot so it will rotate back to the center. This will make the player sprite (which will be a paw) look more dynamic and alive rather than just move on the x axis. This will be a feature for another day though!