Hi Chris! I have a setup with 3 rows of 3 circles, and each circle can be rotated in 4 directions (N, E, S, W) by clicking on a specific hotspot. Once the dials of all 3 circles in a row are set correctly, the player advances to the next row. How would you suggest I implement this so that the settings for each circle are remembered and don't reset? (The artwork isn't finished yet, by the way!)
See screenshot
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Use an Animator with 4 animation states - each one a single-frame animation that points the circle in a different direction. Create an Integer parameter and use transitions to have its values 0/1/2/3 trigger the up/right/down/left animations respectively.
Then attach a Variables component to the Animator, define an Integer variable of the same name, and then attach the Link Variable To Animator component. Fill in its Inspector with details of the shared variable, and set the Variable's "Link to" to "Custom Script".
When clicking a Hotspot, you can then use the Variable: Set Action to increase the Integer variable by 1, or set it to 0 if it's already 3.
Then, check the values of all variables in the same row. If they're all correct, disable the Hotspots and enable those in the next.
Thanks, should the transitions come from the entry or Any State, and should I have an idle state for Entry?
see screenshot
https://www.dropbox.com/scl/fi/ezo1ul50p03d5eso46uit/Rotations.png?rlkey=ozs4jtuq4gjanognmaqee6m38&st=q8hdnyfy&dl=0
Any State.
And I assume I would need a seperate variable for each circle?
Yes - start with one, and then you can prefab things.
I can prefab vartiables?
You can.
A tutorial on working with parameters and variables to prefab logic can be found here.