Howdy ya’ll.
So I’m trying to make a character move using the Xbox 360 controller, and it’s not going that bad, but I have this issue with the player movement where they can only move in 8 directions. Up, up-right, right, down-right, etc. Here’s my code!
// Move the player
curDir = new Vector3(Input.GetAxisRaw("P1LX") * speed * Time.deltaTime, 0, Input.GetAxisRaw("P1LY") * speed * Time.deltaTime );
transform.Translate(curDir.x, 0, curDir.z);
I’m also having this other issue where the player will continue to move for a while, if they stop at all, after I have stopped input. I set the Input Dead to ridiculous numbers but it still happens. I’m not sure if this is an issue with my code or the controller itself.
If anyone can show me what I’m doing wrong or point me to a tutorial on how to do it right that would be fantastic. I’ve been trying to find a good one for a while now but they’ve been useless so far.
Thanks for taking the time to read this
P.S I’ve also used rigidBody.AddForce to no avail. Thought it would help…