- Home /
Question by
dancy166940 · Mar 09, 2014 at 10:03 PM ·
transformvector2keycodegetkeydownhorizontal
Trying to make character move like frogger
Hello, I'm new to C# and unity and I'm trying to make a 2d version of frogger, right now i have;
if(Input.GetKey(KeyCode.RightArrow)){ transform.Translate(Vector2.right movementSpeedright Time.deltaTime); }
and i do that for all 4 keys, originally I was using Input.GetAxis ("Horizontal"); but that was messing with my other objects that move independently, BASICALLY all I want to say is, "if UpArrow is pressed, transform.position.y+10" this way the player would have to lift their finger up and press it again if they wanted to move again, any help would be awesome, thank you!
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613135828im_/https://answers.unity.com/themes/thub/images/avi.jpg)