- Home /
Assets/NewBehaviourScript1.cs(14,26): error CS0117: `UnityEngine.Input' does not contain a definition for `GetkeyDown'
I am new to this and i dont understand what is wrong with my script. Here is my script:
using UnityEngine; using System.Collections;
public class NewBehaviourScript1 : MonoBehaviour {
void Start () {
}
void Update ()
{
if(Input.GetkeyDown (KeyCode.R))
{
gameObject.renderer.material.color = Color.red;
}
if(Input.Get (KeyCode.B))
{
gameObject.renderer.material.color = Color.blue;
}
if(Input.Getkeydown (KeyCode.Y))
{
gameObject.renderer.material.color = Color.yellow;
}
}
}
Comment
Best Answer
Answer by BiG · Jun 28, 2013 at 03:20 PM
The error is telling you that 'GetkeyDown' doesn't exist. In fact, it has the capital K (GetKeyDown()).
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
c#help reversing a script 1 Answer
c# destroy gameobject on 0 hp 2 Answers
New to Unity, Need Help. 1 Answer
c# not going to destination on 0 hp 1 Answer