Skip to content
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

Document how to work with Avian Sensors and CollisionLayers #215

Open
janhohenheim opened this issue Aug 3, 2024 · 0 comments
Open

Document how to work with Avian Sensors and CollisionLayers #215

janhohenheim opened this issue Aug 3, 2024 · 0 comments

Comments

@janhohenheim
Copy link
Contributor

janhohenheim commented Aug 3, 2024

Follow-up to #213
This was requested on Discord.

While Sensors don't have much of a Blenvy-specific quirk, CollisionLayers require some boilerplate because of a lack of bitflag support. This comes up quickly when trying to work with sensors, as you usually only want them to collide with specific layers (notably NOT the default "layer", which is just enabling all collisions). Hence why these two should be taught in tandem.

My personal preference is creating an enum called CollisionLayerPreset that is added on the Blender side and then inserts the actual CollisionLayers in an on_add hook. More sophisticated versions can even validate whether the entity they were added to also contains a Collider or ColliderConstructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant