When i press a key i want my cube's position to change by 1. How can i do it?
I'm very noob at unity and coding righ now. I want to write a script where i press 1 button then 1 is added to my Cube's Z position. Could you write me a very simple, basic script for this?
Answer by viber-tron · May 04, 2018 at 08:59 PM
maybe its that if (Input.GetKeyDown(KeyCode.space)) transform.localPosition = new Vector3(1, 1, 1);
this is a script when you press space the object will go to that position (to change the key you just need to delete the space and put the key (maybe something is confusing i do not speak english very well)
Your answer
Follow this Question
Related Questions
how can i change game to false when the conditions are met in the winner() function? 0 Answers
Animation problem? 0 Answers
My player doesn't take fall damage ... please help 0 Answers
How to copy and paste animation events from one clip to another if those clips are included in FBXs? 1 Answer
How can I add an article to a noun in this C# code? 0 Answers