- Home /
Key down, to edit property
Hello, I am trying to make a script that does the following:
When you press L it should change my (Spotlight)'s range to 20 and when you press L again, it should change it to 60, and then to 20 next time L is pressed :-)
Can you please help me with that? :-)
Thanks in advance, Andreas :-)
Comment
Answer by dpk · Nov 18, 2012 at 10:36 PM
You can use Input.GetButtonDown for this. See http://docs.unity3d.com/Documentation/ScriptReference/Input.GetKeyDown.html and also: http://answers.unity3d.com/questions/350231/check-ifspecifickey-ispressed.html
Your answer
Follow this Question
Related Questions
Waiting for several key presses 2 Answers
Convert String to a type 1 Answer
Simple question about Guitext 1 Answer
Material doesn't have a color property '_Color' 4 Answers
just a simple question.. 1 Answer