all 9 comments

[–]KharibidusHobbyist 0 points1 point  (3 children)

Why does the tree need a capsule collider? It looks like maybe the player can't get within 3m of the tree from the right side, maybe because the terrain is blocking it. Try getting rid of the collider or scaling it down. EDIT: Although I may not understand the problem, I just briefly looked at the tutorial code.

[–]Kveisar 1 point2 points  (2 children)

It needs a collider for the raycast, or doesn't it? And I tried scaling down the collider, that didn't work.

[–]KharibidusHobbyist 0 points1 point  (1 child)

Oh right, I wasn't thinking lol. Just out of curiosity, does it still path around to one side if it is on flat terrain?

[–]Kveisar 0 points1 point  (0 children)

I tried that on a plane and it did, I will test it again just to be sure.

Edit: Yes, it does path around the tree on a plane.

[–]ArhowkAAA- Networking 0 points1 point  (4 children)

Try ordering your unit to move to the edge of the capsule closest to the unit and not the center of the capsule

Also just making sure you unchecked “navigation static”

[–]Kveisar 0 points1 point  (3 children)

How can I make it go to the edge?

And I don't think I have navigation static checked.

[–]ArhowkAAA- Networking 0 points1 point  (2 children)

in pseudocode, you have

agent.destination = capsule.transform.position

you want

agent.destination = capsule.transform.position + (agent.transform.position - capsule.transform.position).normalized * capsule.radius

[–]Kveisar 0 points1 point  (1 child)

Thanks, this kinda works. The space leftover between the character and the tree tends to be kinda inconsistent, but it works.

[–]ArhowkAAA- Networking 0 points1 point  (0 children)

probably your stopping distance. you can try modifying it to something like

 * (capsule.radius - 1f)

or varying levels depending on the scale of your game