reeseschultz / ReeseUnityDemos

Unity packages and demos—emphasizing ECS, jobs and the Burst compiler—by Reese and others.
https://reese.codes
MIT License
515 stars 45 forks source link

Add custom collision filtering surfaces #3

Closed reeseschultz closed 4 years ago

reeseschultz commented 4 years ago

Presently a NavAgent prefab cannot have a collider added to it during authoring, otherwise it will raycast itself when attempting to detect a surface below it in the NavSurfaceSystem. (Knowing the surface below is how we know which surfaces are jumpable for a given agent. It's also how the agent is parented to a custom or default basis for the matrix math involved in planning and lerping.)

This is also an issue when raycasting for forward-facing obstacles in the NavInterpolationSystem. All in all, custom collision filtering must be applied for said raycasts.

reeseschultz commented 4 years ago

Labeled this with 'help wanted' just to emphasize I'm open to someone else submitting a PR to accomplish this.

reeseschultz commented 4 years ago

With #8 closed, getting this issue resolved is critical. There's a few places where default filters are leveraged, and any user who's trying to use colliders will be in for a bad time if I don't take care of this. Will look into it soon.