Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: richard216 on April 12, 2016, 07:19:05 PM
-
Newb question:
A have a global bool that controls when I want to start and stop the rotation of a cube. Listening for the bool to change, I then check the bool and then either tell it to Rotate 10 degress per second, every frame; OR it should set the rotate value to 0 and Per Second or EveryFrame is checked off (to stop it.)
Question - I notice when I fire off the Rotate action, I don't know how (or if I can) Finish off the state. I want it to start the Rotate action, and then continue back the the listen for Bool Change. Right now it just sits at Rotate, stopping the whole FSM.
-
Hey dude,
Rather than type out the answer I made a video to show you:
https://youtu.be/ziV0B5yXK7E (https://youtu.be/ziV0B5yXK7E)
There are lots of ways to use playmaker but this should hopefully work for you.
-
It's a bit weird... that thing you did. The state finishes and it goes to itself. I havn't seen this before. Why did you do it like this? Isn't it a problem?
-
Thanks for the vid. Will try out your solution in a bit. Cheers!
-
No worries richard216. Hope it helps you out.
PET, I wasn't sure if you meant the video I made or richard216 screenshot. But in the video I have a FSM that loops back on itself. It's similar to an update or loop.
It's just one of the tricks or ways I create an FSM. It's not a problem as long as you aren't looping 1000 times within less than a second. But as the state only updates every second its not a problem.
I guess the better way would be to automatically update within the same state. But this can be handy if you are using actions that don't have that option.
I sometimes create a mini loop with a few states for checking variables. So if the variables or conditions of my game aren't what I need for the loop to end, I go back into the loop and check again until they are.
You can always make custom actions as well to keep the FSM's clean.