• Hi Guest!

    We have posted a new VaM2 dev log on Patreon, starting a monthly cadence of written progress updates between Beta releases. Highlights include the new Gizmos System, Selection Carousel, and Modes System with Context-Specific Editing. Beta1.2 is 15 of 21 items complete.

    Read the full post on Patreon, or follow progress on the public Trello roadmap.

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

pinosante

Well-known member
Joined
Mar 7, 2021
Messages
417
Solutions
1
Reactions
576
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