-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to make it work with physics (rapier) and gravity? #83
Comments
In the following official demo, the nav mesh isn't flat: https://mugen87.github.io/yuka/examples/navigation/navmeshPerformance/ You can use the standard |
https://github.com/Mugen87/yuka/blob/master/examples/navigation/navmeshPerformance/index.html
|
thanks for all these! so my (hopefully last) question would be: can we use wanderBehavior AND followPathBehavior + onPathBehavior together? I would like wanderBehavior because I want the vehicle to wander randomly without following a specific path. There is also an issue that remains, when I give them a followPathBehavior, they completely disregard the navmesh in between: they can go through / fly above / go under the geometry etc; they just take the shortest LINE from point A to point B regardless of what's in between. I tried to play with the value of followPathBehavior.nextWaypointDistance like in your example shared above; EDIT: On the other hand, this example you shared seems to create a spatialIndex, yet it isn't used anywhere? (in the follow path function etc) |
I'm also trying to intergrate this with my threejs rapier based project. @pierroo can you share anything that can help since you had a head start on this? |
I am trying to make a vehicle wandering all over the navmesh randomly.
However the navmesh isn't just a flat plane, but has lot of ups and downs etc.
Every docs and examples and codepen I find online using Yuka are having super simple and flat navmesh; so navigating along a slope or mountain is never a question.
So I was thinking to apply Yuka on a Rigidbody from rapier to at least have the gravity and make sure the vehicle is constantly touching ground, but it's a nightmare to manage force applied etc.
Is there a way to make sure a vehicle follows the NavmeshConvex including its y position?
EDIT: unless I raycast from every vehicle inside their useframe toward under them and adjust their y position accordingly, but this sound like a very heavy query on each frame no?
The text was updated successfully, but these errors were encountered: