Skip to main content
D
3mo ago

Joysticks in State Machine

Hi! Is it possible to use joysticks in the State Machine? Like for example, to make a cursor tracking animation.

4 replies
D
3mo ago

Hi You can use two number inputs (X,Y) to move the joystick or you can also make the joystick follow the cursor with the pointer move option. Is any of this what you want to do?

D
3mo ago

Yes, I'd like to make the joystick follow the cursor

(edited) 3mo ago

Hi Deborah!
The set-up is a bit fiddly, but here's what you gotta do:
1. Set-up your Joystick
2. Attach desired timelines to X and/or Y axis
3. Create a Target right in the center of the joystick and assign it to the 'Handle Source' property
4. Create a second target in the middle of your canvas
5. Add a translation constraint to the Joystick Handle target (the one you created first), make sure to select 'Offset' before assigning the target (the second target you created) so that the target won't move.
6. Create a shape. This shape will be the region where the cursor will be tracked.
7. Create a listener using that shape
8. In the listener properties, add an 'Align target'
9. Set its target to the second target you created in step 4

Here's a video, skip to 3:20. Might be even more helpful than this huge to-do list:

D
3mo ago

Thank you very much! That was really helpful