Filter Accessed Time won't reset when moving scene.

NodeCanvas Forums General Discussion Filter Accessed Time won't reset when moving scene.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #11455
    jhorikawa
    Participant

    Hi,

    When using Behaviour Tree I want to run specific nodes just once when scene started so I was using Filter decorator by setting its limit number of times to 1.
    The problem with the Filter decorator is that when I move to another scene and coming back to the scene where I used Filter decorator once, it remembers the previous access so it won’t run any more even if it is the start of the scene.

    Is there any way to reset the accessed time for Filter decorator when scene started or is there any alternative way to achieve this?

    Thank you,

    #11459
    Gavalakis
    Keymaster

    Hello,

    The Filter Decorator is indeed correct to be used in this case.

    All Behaviour Tree nodes, including the Filter Decorator’s access times, will be reset when the BehaviourTreeOwner’s behaviour, Stops/Restarts.
    By default, the BehaviourTreeOwner, will stop when it is disabled or destroyed (which also happens when another scene is loaded), if the “OnDisable” option in it’s inspector is set to “Stop Behaviour”. Have you maybe changed this option?

    Another reason that the BehaviourTreeowner would not stop on scene load, is if you have manually set the gameobject to DontDestroyOnLoad.

    Is any of the above the case?
    Thanks.

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

    #11491
    jhorikawa
    Participant

    Hi,

    Thank you very much for your reply and I’m sorry for being late to reply.
    The problem was as you mentioned is with the “DontDestroyOnLoad” used in gameObject.

    Now it works just fine.

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