move to problem/bug

NodeCanvas Forums Support move to problem/bug

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11063
    markusr
    Participant

    hi,
    i wonder why my object not moveing to the click location.
    the usage of resetpath make trouble.
    it is integrated in move to object and move to position.
    i made a screen video:
    Screen Video at Youtube

    #11073
    Gavalakis
    Keymaster

    Hey,

    Thanks for the video and information.
    The reason why ResetPath exists there is that if the action is stopped before completion (interrupted), it also resets the path, thus interrupting pathfinding as well.

    The problem here is due to having an inbetween state for the tweening and because that state takes some time to complete.
    Have you tried putting both “Tween Position” and “GoTo” actions in the same state directly under the AnyState transition? Or is this something you dont want to do for some reason?

    Let me know.
    Thanks.

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

    #11089
    markusr
    Participant

    @Gavalakis
    hi,
    i think i found why it stops
    this condition with remainingDistance have wrong values
    its 0 before going what will stop direct, also if me will moving a 2 units distance.
    my test was stoppingDistance =0,keepDistance is 0.1
    so remainingDistance =2 <= stoppingDistance + keepDistance 0+0.1 can’t be true
    try this row with remainingDistance>0, so the distance must calculated once after it was 0.

    if (agent.pathPending)
    {
    //wait
    } else {
    Debug.Log(agent.remainingDistance);

    //if (agent.remainingDistance>0f && agent.remainingDistance <= agent.stoppingDistance + keepDistance)
    if (agent.remainingDistance>=0f && agent.remainingDistance <= agent.stoppingDistance + keepDistance)
    {
    Debug.Log(agent.pathStatus); //PathComplete
    Debug.Log(agent.pathPending);
    Debug.Log(agent.stoppingDistance);
    Debug.Log(keepDistance);
    Debug.Log(“EndAction 3”);
    EndAction(true);
    }

    }

    note: i using waitpick with a vector 3 and goto vecto3 without tweening but
    my problem was with goto vector and goto object action task.

    #11097
    Gavalakis
    Keymaster

    Hello,

    I’m sorry 🙁 It is a bit hard to understand what is your suggested solution/fix in your post. Is it changing the check to this:
    if (agent.remainingDistance>=0f && agent.remainingDistance <= agent.stoppingDistance + keepDistance)?

    If not, can you please rephrase your solution?
    Thanks in advance.

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

    #11103
    markusr
    Participant

    hi Gavalakis,

    not
    agent.remainingDistance>=0f

    this may fix it
    agent.remainingDistance>0f

    i used to compare the behave

    i think for one cycle the remainingDistance stay at 0 and is not calculated.
    maybe its a sideeffect from resetpath usage.
    at !agent.pathPending i expect a Distance in remainingDistance

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