-
Notifications
You must be signed in to change notification settings - Fork 16
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
Difference between jump and fall #3
Comments
You can distinguish between navgen's fall and jump two navlink prefabs with NavMeshLinkData.bidirectional. Look at how the NavMeshComponents example AgentLinkMover traverses links. Instead of immediately starting your movement coroutines, you could check the navMeshOwner to access the prefab: var link = agent.navMeshOwner as NavMeshLink;
bool is_fall = link != null && !link.bidirectional;
// or create a NavLinkData script and add it to your prefabs
// so you can get any data out of them you want
// (including an animation or animparam):
var my_link_data = link.GetComponent<NavLinkData>();
PlayAnim(my_link_data.animation); NavMeshLink also lets you set an area, so you could look at that value for multiple categories of links. |
Wow! thank you very much for support and reply. |
Unfortunately, I don't think navgen will handle overlapping surfaces very well (like two floors in a house). But you can place the navlinks yourself as well -- you don't have to generate them. NavMeshComponents documentation is a bit weirdly separate from the other navmesh docs, but there is a manual section that's worth looking into. |
Thank you very much for support. |
Yes. Be sure you add the NavLinkData component to the prefabs that you set in NavLinkGenerator.
Yes, you'd have to check if you're closer to the startPos or endPos to see if you should jump up or down for bidirectional links. |
thanks for suggestion, is possible to have a navmesh link that cover the whole floor to ceiling? figure a situation where enemy is chasing player from ceiling and need to fall to floor to continue chasing him, i think navmesh link is not useful here really? we cannot tell the enemy to search for some wall and move down, maybe its better if path is partial to player to jump to floor and use aninmation here really? instead to use navmesh link from ceiling to floor |
You mean you have something like the above screenshot (a cube with links dropping down from it) but only some directions work properly? Can you post a screenshot of your links and which ones work correctly? Possibly navgen is placing the links incorrectly -- likely because your geometry is too complex for us to handle. You may need to move some of the navlinks out from under the "Generated NavLinks" gameobject to manually adjust them to work correctly. |
Hi guys thanks for the project
I have take a look and see how works parabola, curva etc... while in link on navmesh, but how can i get if i need to fall or jump to play any animation during this event instead of teleport to destination point?
The text was updated successfully, but these errors were encountered: