Hey I wanted to code this game first and I do not know what went wrong. here is my code using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { private Rigidbody rb; void Start () { rb = GetComponent<Rigidbody>(); } void FixeUpdate () { float moveHorizontal = Input.GetAxis("Horizontal"); float movevertical = Input.GetAxis("vertical"); Vector3 movement = new Vector3(moveHorizontal, 0.0f, movevertical); rb.AddForce (movement); } }
Neither do we, because you haven't told us. Sometimes, just for fun, I like to guess, but my guesses usually turn out to be wrong. Why don't you save us the trouble and tell us what is happening that you don't want to happen, or what isn't happening that should?
Welcome to the forums, @Nero1inen! @JoeStrout is correct -- as always -- in his assessment, but I'd like to mention that your question is common enough to warrant adding to my own ongoing FAQ, which may have other relevant content for you. In response to your question here, though:
Two immediate problems stand out to me. Code (csharp): float movevertical = Input.GetAxis("vertical"); First, like @Kiwasi mentioned the GetAxis function is case sensitive. You need to capitalize the "V". Code (csharp): void FixeUpdate () That said it was never getting the opportunity to run the code because of the second problem. You misspelled the function name. It needs to be "FixedUpdate".