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

pinosante

Well-known member
Messages
385
Reactions
431
Points
63
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