- Home /
Question by
sir-foxwoods · Jan 13, 2014 at 02:40 AM ·
context
how do i add (Vertical) to context in untiy 4 its telling me its a compiler error
using UnityEngine; using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float forwardSpeed = Input.GetAxis (Vertical);
Vector3 speed = new Vector3 (0, 0, forwardSpeed);
CharacterController cc = GetComponent<CharacterController>();
cc.SimpleMove ( speed );
}
}
Comment
Change this
float forwardSpeed = Input.GetAxis (Vertical);
to this
float forwardSpeed = Input.GetAxis ("Vertical");
Your answer
Follow this Question
Related Questions
Why does AddComponent not exist in the current context? 2 Answers
wierd not existing in current context error caused by 2 lines of code 2 Answers
Anyone have problems with iOS game center score.context? 1 Answer
The name hitFactor does not exist in the current context 0 Answers
Why don't I get access to current context with wglGetCurrentContext (OpenGL) 1 Answer