-
Notifications
You must be signed in to change notification settings - Fork 1.1k
NavMeshSurface - support for tree colliders #101
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
base: master
Are you sure you want to change the base?
NavMeshSurface - support for tree colliders #101
Conversation
There was missing TryCast extension method, fixed |
@turadr Could we please have a review on this? Would be so awesome to have this available in the NavMeshComponents. Thank you! :)) |
@hendriku We appreciate the work put into this PR but unfortunately we cannot take contributions to this repository right now. If that will become possible in the future we will then address this PR. |
thanks, that's useful! |
SphereCollider sphere; | ||
CapsuleCollider capsule; | ||
MeshCollider mesh; | ||
if (collider.TryCast(out sphere)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (collider is SphereCollider sphere)
, etc
After sources are collected by calling
NavMeshBuilder.CollectSources
, go through and add tree colliders for eachTerrainCollider
encountered.Supported tree colliders are: Sphere, Capsule, Box, Mesh.
Tree colliders are added with hard-coded area
Non-walkable
.NavMeshModifier
on trees is not supported (yet).NavMeshModifierVolume
should work as usual, even on trees.In future I'd like to support
NavMeshModifier
and use default area instead of hard-codedNon-walkable
Resolves #30