0

Newbie...How can I stop my player from walking straight through the fence? I need to keep the navmesh in place, as longer-term want him to be able to destroy part of the fence and walk through.. https://www.loom.com/share/693b10bf6c064715a99232be31e11b8b

I have a box collider on the fence. Player has a ridgebody...

I saw this post, but does not resolve Unity3D Player walking through and on the Stone

Dano007
  • 1,872
  • 6
  • 29
  • 63

1 Answers1

0

Just add a Nav Mesh Obstacle component to the fence and check the Carve. In this case, the fence deviates from the path and your character moves along it. The carve option will force fence to updated in real time, and solves the second problem but If you want to create a gap between the fence, you have to divide the fence into two semi part fences through specific script and give each of them Nav Mesh obstacles according to the same parameters.

enter image description here

enter image description here

KiynL
  • 4,097
  • 2
  • 16
  • 34