How do I detect behavior state?

0 favourites
  • 2 posts
From the Asset Store
State Machine
$5.99 USD
State Machine is a great tool for managing the state of anything in your game.
  • Hello all,

    Im building my first game where a guard tries to track the player. The guard implements bullet and pathfinding and switces between the two depending on game conditions. Is there a way to detect the behavior state (enabled or disabled), like through some system expression, in order to log it for debugging reasons?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well, enabled/disabled no.

    But in the case of the bullet behavior, there is a condition that allows to compare its speed. If instead of disabling the bullet you just go to set its movement speed to 0, you can then have conditions that if Bullet speed = 0 then the bullet is "not active", or if Bullet speed > 0 the bullet is "active".

    Same order of idea for the Pathfinding, the condition "Is moving along path" allows you to know that the behavior is active and moving the instance along a calculated path.

    Finally, if you really want to, you can add two instance booleans that will allow you to check for the behaviors states when you enable/disable them.

    Something like "BulletEnabled" and "PathFindingEnabled" that are either true or false.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)