Question by
cristian2104 · Apr 02, 2016 at 06:10 PM ·
errormovementphysicsplayer
Can someone please tell me whats wrong with this?, because when i put it says error in the GetAxis
Please help
using UnityEngine; using System.Collections;
public class NewBehaviourScript : MonoBehaviour { public float MoveSpeed;
private Vector3 input;
// Use this for initialization
void Start () {
}
void Update () {
input = new Vector3(input.GetAxis ("Horizantal"), 0, input.GetAxis ("Vertical"));
print (input);
}
}
Answers?
Comment
Answer by gjf · Apr 02, 2016 at 02:56 PM
when posting code, make sure that you format ALL of it.
your error is most likely because you wrote input.GetAxis()
instead of Input.GetAxis()
- you need to pay special attention to the case of functions/variables/etc.