Hey guys, so I currently have for my script a simply upward jump script, as shown below.
if (Input.GetKeyDown(KeyCode.Space)) {
rigidbody.AddForce(Vector3.up * jumpPower, ForceMode.VelocityChange);
}
Worked great for my character for the time being. Then I decided to use Unity-Chan so I could have some practice with an Animator. When I attached the animator, the jump code suddenly stopped working. I did a search online and found that I may have to set the "Update Mode" in the Animator to "Animate Physics," but even after setting it up, my rigidbody function still didn't work. However, if I disable the animator, the rigidbody function works once more. Any ideas on how to fix this?
tl,dr: rigidbody.AddForce works before Animator is attached, and when Animator is disabled, but not when Animator is enabled, or when Animator is enabled and "Animate Physics" is checked.
↧