- Home /
Question by
Darn_ · Jan 12, 2019 at 09:53 PM ·
physicsainavmeshnavmeshagentnavigation
Allow navmesh agents to be pushed off navmesh
I want my navmesh agents to be pushed by other scripts. This works, except the agents are not allowed to leave the navmesh. In my level I have pits I'm trying to push the agents into, but I can't because of this. I don't care about pathfinding anymore once I push the agents off. What is a sensible way of doing this?
Comment
Answer by Magso · Jan 12, 2019 at 10:10 PM
Disable the NavMeshAgent when the it is close enough to a pit.
That seems a bit hacky. I was hoping there was a cleaner way to do it.
It's probably the least hacky way to do it.
GetComponent<Nav$$anonymous$$eshAgent>().enabled = false;