How to make sequencer can’t get interrupted midway through

NodeCanvas Forums Support How to make sequencer can’t get interrupted midway through

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18003
    masked_obito
    Participant

    I have dynamic selector with conditional child to check if player distance < 15, run sequencer for this enemy to seek player, at the end of sequencer I have one more conditional to check if player distance < 4, if true then run sequencer for this enemy to execute function explode, play animation, and destroy itself.

    The problem is when this enemy explode, explosion force pushes player causes player distance to be more than 4, since my explosion animation set to wait until finish, this enemy fails to destroy itself.

    Is there a way to make sequencer can’t be interrupted/reevaluate even when im using dynamic selector?

    Attachments:
    You must be logged in to view attached files.
    #18073
    Gavalakis
    Keymaster

    Hello,

    Unfortunately (or fortunately depending on the situation :)), the dynamic selector is designed to work like that (meaning to interrupt everything below it). Based on your tree design, you could probably add another condition on the right dynamic selector branch to also check a boolean variable like ‘isExploding’ and set the conditions to “ANY TRUE”. So the conditions will look like ‘if Distance < 15 to $Player OR $isExploding’.
    Then of course you will also need to set that $isExploding variable somewhere (probably next to the ‘Self.Explode() action task).

    Let me know if that works for you.
    Cheers!

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.