Search Unity

Question How to CalculatePath around several other agents?

Discussion in 'Navigation' started by Wayne-wyj1994, Jan 10, 2021.

  1. Wayne-wyj1994

    Wayne-wyj1994

    Joined:
    Nov 13, 2019
    Posts:
    30
    The yellow agent moves to somewhere backwards the red agent.The path shows as below,just like a straight line,which doesn't consider the red agent.
    upload_2021-1-10_11-45-38.png
    When the yellow agent continue to move ,two agent check avoidence and the yellow one would move around the red one to avoid it
    upload_2021-1-10_11-50-12.png
    But, I want to calculate this path when invoking Setdestination() and CalculatePath(),Because I need the path point and path status to do other things,just like path as below.
    upload_2021-1-10_11-49-28.png

    I know attaching obstacle to red one can help,but I couldn't because other function would fail if the red agent has obstacle component.
    Does anyone have idea about this?
     

    Attached Files: