Switches for Select
I am new, and am completely stuck. Please suggest me direction on how to solve this stupid road-block or why I am doing it wrong.
Problem: I want to set 2D animation (top-view) to a character based on the angle he is walking to. I get the vector, normalize it. And then I want to do something like this:
if angle in range [-45, 45] set Option 2
else if in range [45, 135] set Option 0
And so on…
How could I do this in my current situation?
Make a function to work it out. That is my problem. I do not know how to make the function with several tests so that it would bring out single output. Last few hours I tried, i ended up splitting into too many branches and never finding a way to combine them together.
For simplicity let’s say I want: [320, 360] - Option 0, [0, 50] - Option 0, [50, 130] - Option 1, [130, 220] - Option 2, [220, 320] - Option 3
Make a function to work it out.
Get float, If float between -45 and 45 then VAR = 1 etc etc
I would leave the one the goes from 360 to 1 to the last one as if it is not the rest the it has to be that one and it will make code a lot easier.
First up, give me ranges of angles you want to work with, the four groups.
Ok to start with
Make a function and add an input and and output shown here.
Input - float / output = INT
Make a VAR that is INT for output and join it up to OUTPUT.
Make a VAR called input and make a float
Then do this. I hope it make sence
Just be careful, I just saw I had 320 in there twice, you may need to change one to 321 or something like that.
Thank you very much. I will try it out now
What is that small orange rectangle with a dot at the bottom of next to last screenshot?
If you double-click on a connection, you get a reroute node. Basically just lets you rearrange your connection for brevity.