Unity version: 2022.3.21.f1
I am using the navmesh graph to make agents walk around a Dinossaurs Teeth, everything going well until I tried to use the NodeLink2 to add a jump mechanic between parts of the graph.
The agent is using the FollowerEntity Script and I used the jump script from the documentation example.
The problem is: When the agent jumps I can’t change its rotation, it will always be rotated so its down vector faces the the start point of the link. When it lands, it doesn’t land on its feet and gravity makes the agent fall off the Navmesh.
I could not set the rotation of the agent no matter what I tried, It seems the FollowerEntity is setting its rotation towards the last navmesh normal on everyframe and I can’t overwrite it.
On the image above, the top point is the start, the agent is in the middle of a jump towards the bottom point. Notice how its down vector always faces the starting point of the link, it lands that way and gravity is applied in that direction after landing.
I tried changing the rotation in many ways with no success, I even tried changing the movement plane
to match the end point up vector, but I couldn’t do it too.
There was also another thread where Aron suggested using SetDestination() to the agent’s current position, and using the rotation argument to set it’s rotation:
This was in the context of “rotate to keep looking at another agent” though, but it still may be helpful here. Let us know what you think