PauseBehavior() doesn't seem to work

NodeCanvas Forums Support PauseBehavior() doesn't seem to work

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10408
    cbrandick
    Participant

    Hey!

    So, I want to be able to play and pause a behavior tree from another behavior tree and vice versa. I have two behaviour tree owners on a single gameobject and have the instances stored in a BTManager script on that gameobject. This works fine and is in the code that is attached. I am able to pause/play a BehaviorTree and it shows as such in the inspector (the play/pause button change), but the tree that is supposed to pause doesn’t pause. However, if I use “stopbehaviour()” that works fine… Thoughts?

    Thanks!

    C

     

    functions that I can call from within a behavior tree to pause/play particular trees.

     

    and iterated through them using a Behavior Tree Manager script so that each one is held in a separate script so that I can pause and play them from the manager. I created a “pause” and “play” function that I can call

    #10410
    Gavalakis
    Keymaster

    Hello,

    I just tried your script here and Pausing the behaviour trees works fine. I mean they actually get paused apart from the icon showning them paused in the inspector.

    To test it by the way, I just added this in your script:

    Does doing the above not work for you?

    Thanks.

    (PS: Sorry for the code formatting bug. It’s now fixed)

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

    #10411
    cbrandick
    Participant

    That does work. 🙂
    It seems like you can pause/unpause once, but after that first time it doesn’t work anymore…

    Do you see that as well?

    #10412
    cbrandick
    Participant

    The way I did this is I put the BT manager in a parent object with a BTOwner. It had the following tree.

    Then in a child object there was another BTOwner which only had a timer to test if it was being paused or not… I ran the parent on repeat.
    It works the first time through, but the timer acts weird and doesn’t stop the second time the “pause” behavior is run.

    #10413
    Gavalakis
    Keymaster

    Hey,

    So, I did test exactly that and still it works. I have attached the test case here. Let me know if this works as expected for you. The BT get paused and unpaused correctly.

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

    Attachments:
    You must be logged in to view attached files.
    #10416
    cbrandick
    Participant

    *Edit – Refreshed and found it!!

    Hey to you,

    I don’t see the attachment… I’m a lost soul. 😉
    Could you point me in the right direction.

    #10417
    cbrandick
    Participant

    This is a better example of what I am trying to do. If you look at the child object, the pause stops working the 2nd time around…

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

    Hm. The contents of your attachement is exactly the same as the one I’ve send, except that “BTManager_2” right?
    So. Because it works fine here, I am going to suppose that it’s something fixed in the last version.
    If you drop me an email at ‘support@paradoxnotion.com’ with an invoice ID, I will send you the last version asap which is exactly what Im using here and this example works fine.

    Thanks!

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

    #10422
    Gavalakis
    Keymaster

    By the way, the new version is also already submited to the asset store and will be live at any moment 🙂

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

    #10423
    cbrandick
    Participant

    I created two behavior trees that should be linked to the gameobject. In your version there weren’t any BTs… Odd.
    I will wait and try out the new version before bothering you again. 🙂
    Thanks!

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