Character Will Not Move from Spot (At All)
Redirect: http://answers.unity3d.com/questions/1106870/character-cannot-move-from-its-spot.html
I've got a multi-player project where I'm using a state machine on a character (that is instantiated at a certain spot) with a character controller. The script takes input every frame, but for some reason the character won't move at all.
This is the movement section of the script:
private void movement() {
if (movementHorizontal > 0) {
player.thisChar.transform.rotation = Quaternion.Euler(Vector3.zero);
}
else if (movementHorizontal < 0) {
player.thisChar.transform.rotation = Quaternion.Euler(0, 180, 0);
}
movementDirection = new Vector3 (movementHorizontal, 0, movementVertical);
//player.thisChar.transform.position += movementDirection * player.speed * Time.deltaTime;
player.controller.Move (movementDirection * player.speed * Time.deltaTime);
}
The player will turn, as expected, however they will not move from that spot. I've tried using RigidBodies, I've tried editing the position directly (hence the commented out part of the script), and even editing the position in the inspector. IT WILL NOT BUDGE.
The entire project file can be found below. I really need help, I can't figure out what's going wrong.
https://drive.google.com/file/d/0ByMNe0bC15PxekN0RHM0RWVpTFk/view?usp=sharing
I found the error and it's a stupid one. I made the old beginner mistake of not checking the "Apply Root $$anonymous$$otion" option on the Animator.
Follow this Question
Related Questions
Character Cannot Move from its Spot 0 Answers
Ethan unable to leave a position on the scene 2 Answers
How to move my rigid body in the direction my model is facing. 0 Answers
Stop moving gameObject and push it back 0 Answers
Isometric Movent Issue 0 Answers