• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. 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.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.

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

pinosante

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