playMaker

Author Topic: FSM that lets NavMeshAgents go off the mesh  (Read 730 times)

TrueSoSense

  • Playmaker Newbie
  • *
  • Posts: 17
FSM that lets NavMeshAgents go off the mesh
« on: January 18, 2022, 04:13:15 PM »
Hello, i ran into an issue, I want my NavMeshAgents to be able to fall from cliffs or jump, but NavMeshAgents can't exit the NavMesh... It is a Unity issue but i want to fix it with playmaker if possible.
Maybe using Active ragdolls or other stuff.
Maybe creating a custom pathfinding (using sensors and other stuff...).

Can anybody help ?


Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: FSM that lets NavMeshAgents go off the mesh
« Reply #1 on: January 19, 2022, 02:07:41 PM »
Depends what exactly you need to use it for.

https://docs.unity3d.com/Manual/nav-CreateOffMeshLink.html

Off Mesh Links already let you create jumps or falls, but in fixed positions.

If you needed something more generally like a huge cliff boundary where they could go off anywhere, you might go with disabling the navmesh agent component when it hits a trigger area for the boundary. While it's disabled you could move the character around however you want and then turn back on navmesh when it's at the bottom. Navmesh stuff can take a lot of tweaking and polish to add cool features to it, but it's doable with enough work.

TrueSoSense

  • Playmaker Newbie
  • *
  • Posts: 17
Re: FSM that lets NavMeshAgents go off the mesh
« Reply #2 on: January 19, 2022, 03:06:02 PM »
i found a way to fix it, but i need help, basically what i want to do is to get the position where the agent wants to go, then the GameObject should look at the position and move using add force or something like that...
The only problem is that the GameObject is not moving when i use add force.
I think i will post another topic for this.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: FSM that lets NavMeshAgents go off the mesh
« Reply #3 on: January 19, 2022, 09:26:37 PM »
HI.
you should not use Add force for player/enemy movement as its very cpu heavy.

i don't know if velocity works with navmesh, else try move to and look at.

maybe this video can help :