[BUG] SELECTOR does not execute child

NodeCanvas Forums Support [BUG] SELECTOR does not execute child

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16420
    wrymn
    Participant

    As you can see from the picture, the SELECTOR does not execute the child “Move To Position”, even when set as DYNAMIC, and task “Is Close To Target” does return failure.

    Expected behavior is that “Move To Position” is executed when “Is Close To Target” returns failure. I have been debugging this for more than an hour with no success. Sometimes it executes, sometimes not.

    Please see attached screenshot

     

    I have put a debugger breakpoint into  “Is Close To Target”, it runs the OnCheck() and it returns false. The breakpoint in  “Move To Position” does not run for some reason, which does not make sense, as it should be next in order and executed after previous task failure.

     

    Attachments:
    You must be logged in to view attached files.
    #16426
    rdt42
    Participant

    I had this exact issue too. The problem here is that MoveToPosition returns success once the node succesfully reached that position. When trying to execute again, it will only call the Execute function if the previous result was Resting or Running.

    What I’ve done is change the code in ActionNode.cs, where I also allow the ActionNode to reevaluate when the previous result was Success.

    #16429
    wrymn
    Participant

    wow, this seems a bit hacky and strange that this does not work out of the box 🙂

    When trying to execute again, it will only call the Execute function if the previous result was Resting or Running.

    Do you mean Execute function of MoveToPosition or IsCloseToTarget?

    What I’ve done is change the code in ActionNode.cs, where I also allow the ActionNode to reevaluate when the previous result was Success.

    May you please tell me the exact line if you remember? 🙂

    #16430
    rdt42
    Participant

    This happens for any ActionN0de. I guess there is a reason for why it works this way, but it doesn’t fit my way of working, so I changed it.

    It’s in the OnExecute() function in ActionNode.cs. It  starts around line 32, and I’ve made it into what you see in the screenshot.

    Note that I only added the last ‘|| status == Status.Success’ in the second if statement.

     

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

    Hello,

    Like @rdt42 said, the Move to Target immediately returns success if the target is reached (which I believe makes sense). I wouldn’t suggest making that change to ActionNode since that is not a solution to making Move to Target execute and I don’t recommend that change even though it works for rdt42 🙂 You can change the Move to Target instead if you want to alter its behaviour though.

    Thanks.

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

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