- Home /
Question by
Venividiviciuus · Feb 10 at 08:48 PM ·
scripting beginnerselection
Menu selection movement in 2x2
Hi sorry if there is any similar thread but I didn't know what to look for then;
I wanted to ask you I have a 2x2 menu and I have to move from one option to another with a select but without continuing ... but moving with the arrows according to the direction when possible. up-
I can move from text0 to text1 with → but from text1 to text2 i have to do ↓← or ←↓ simple.. a directional movement.
Example:
//my menu
text0 text1
text2 text3
I was able to create a script but not accomplish what I am looking for.
//my script
void HandleActionSelection()
{
if (Input.GetKeyDown(KeyCode.RightArrow))
++currentAction;
else if (Input.GetKeyDown(KeyCode.LeftArrow))
--currentAction;
else if (Input.GetKeyDown(KeyCode.DownArrow))
currentAction += 2 ;
else if (Input.GetKeyDown(KeyCode.UpArrow))
currentAction -= 2;
Comment
Your answer
Follow this Question
Related Questions
How to individualize objects with same script? 0 Answers
Inherite a script to a child 1 Answer
Grabbing objects in a zero gravity enviroment? 0 Answers
Bug on first play or after building 0 Answers