- Home /
This question was
closed Nov 22, 2014 at 09:50 PM by
robertbu for the following reason:
Duplicate Question
Question by
Kuaczor · Nov 22, 2014 at 09:50 PM ·
not-working
Input.GetKeyDown working smoothly
I want to make simple movement, but i have a problem. I have to click right arrow many times in order to move object. What should I do to make it work repeatedly when I simply hold the button?
void Update () {
if (Input.GetKeyDown(KeyCode.RightArrow)) {
transform.Translate(new Vector3(movement_speed,0,0));
}
}
Comment
Change to using Input.Get$$anonymous$$ey(), which will fire for every frame the key is held down.
http://docs.unity3d.com/ScriptReference/Input.Get$$anonymous$$ey.html
Your answer
Follow this Question
Related Questions
Multiple Trigger Script doenst works! 1 Answer
Audio Streaming Not Working 1 Answer
help to add more details to my project 1 Answer
Why won't my character register as near? 2 Answers
Game dont work on Zenfone 5 0 Answers