I would like to make an different animation depending if the switch is off or on.
Let say if my switch is ON my sprite move x +10 if my switch is OFF my sprite move y +10
I don't find a correct way to apply it. Thanks
I would like to make an different animation depending if the switch is off or on.
Let say if my switch is ON my sprite move x +10 if my switch is OFF my sprite move y +10
I don't find a correct way to apply it. Thanks
You could use one out of three PatchTrees with a simple logic. The first one works like this: after pressing LMB, your sprite translates 0.1 along +X. After releasing LMB sprite returns to its default position (0). The same thing happens with pressing and releasing RMB (Y+0.1).
The second scheme uses slightly different logic: clicking LMB you translate your sprite X+0.1 and clicking RMB you translate your sprite Y+0.1. This logic can be accomplished if you use "Counter" patch (with "Reset" parameter).
Remember! your QC's default XY grid ranges from -1 to +1 for X and Y (totally 2 for each axis).
The third one is a switcher based on a formula of inversion: abs(a-b). b=1. I used patch named "Mathematical expression". This PatchTree is made just for one input (LMB for instance). Maybe third scheme is what you are looking for.
Logic is simple:
...