• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Solved A way to test in which state a statemachine is?

pinosante

Well-known member
Joined
Mar 7, 2021
Messages
406
Solutions
1
Reactions
555
Hi, I'd like to know which state the statemachine is when I trigger a button.

Something like:
if state = 3:
trigger relay which is 3.
if state = 4:
trigger relay which is 4.

How do I know what state a statemachine is in?
 
I know this isn't precisely what you asked, but based on what you're trying to do, I think you should be looking at "select choice". Check out the Demo scene that came with the logicbrick.12 download from the hub, it's in the 01-14 example set
 
Upvote 0
I know this isn't precisely what you asked, but based on what you're trying to do, I think you should be looking at "select choice". Check out the Demo scene that came with the logicbrick.12 download from the hub, it's in the 01-14 example set
I solved it by letting the statemachine write it’s state number to a UIText, and using a SPQR Dynamic Trigger with the number as a variable to reactivate the state I needed. (That was my case: if I am in state4 how can I redo state4 with the press of a button). You can use the select choice you mentioned, as the target of the dynamic trigger to do whatever you want based on the state. Thanks.
 
Upvote 0
Back
Top Bottom