I am currently working on a project which uses rigidbodies for both the player and enemies. While I have used collision masks to successfully allow players and enemies to ignore one another while colliding with the wall and ground, they no longer interact with trigger entities.
Is there any way for me to find out which collision mask is required to interact with triggers as they do not have a rigidbody component?
Many thanks for that link, it really helped that i can actually see the group numbers. I had followed the script I saw in a different topic and had first cleared the group and masks (by setting them to 0) before reapplying a new group and mask bit.
Edit: How do I refer to these numbers, as I had been using the bit shift on integers ( this.entity.rigidbody.group |= 1 << 1)
Thanks for the reply, based on your input, my approach had been flawed as I had been unknowingly using bits reserved by the system and ended up with weird results.
On an added note, is there a way to access the trigger mask (16) with a bitwise shift?
I’ve noticed in the link page that triggers appear to reside under pc.BODYGROUP_TRIGGER: 16.
Using the mask system to target the bodygroup allowed me to finally get my triggers to be detected by the colliders but i was wondering if I could use e.g. 1 << 16 to access the trigger layer (although the example i gave did not seem to work.
So based on your response, the only way for a rigidbody with a custom mask to interact with triggers is to manually call for the rigidbody.mask |= pc.BODYGROUP_TRIGGER
I wish there was a better way to do this, but it’s at least clearer for now.