So I’m having a bit of an issue with implementing a shield for my player. I have a shield child object on my player which has both a box collider and a rigidbody, and I have a capsule collider and a rigidbody on my parent player object as well. I’m able to detect from the enemy script whether the enemy collides with the player or shield, but as you can see, the shield’s collider passes through the enemy which allows my player to collide with the enemy as well, which I obviously don’t want.
When the player holds the shield button, i enable the shield’s collider (as in set the gameobject to active) and don’t want anything to go through the shield collider and touch the player. Removing the rigidbody on the shield fixes this issue but then collisions are only detected on the player and not the shield.
Any ideas as to why the shield collider moves through other gameobjects? (the enemy also has a capsule collider and a rigidbody and none of the colliders are set to trigger). Of course if there’s a better way to implement my shield functionality all together, I’m open to that as well.
][1]