- Home /
Make collider work for some objects
OK, right know I want to create a dropshield like halo reach game. As you know the dropshield not permit the pass of bullets, grenades, rockets, etc., but the player can get in or get out of the dropshield, that means that it has a collider that permit only the pass of a player. I know it could be a simple solution if you make it trigger and when the bullet collides(OnTriggerEnter)the bullet is destroy, but I actually want to make it bounce and also with grenades wont work. So I want a know if there is a code that permit this or a tactic to make the dropshield. Basically I want to make something like this:
dropshield.collider.PermitPassTo(player);
Answer by save · Jul 02, 2011 at 03:36 PM
Set your shield and player to different layers, then use the Layer Collision Matrix in Edit > Project Settings > Physics to alter what collides with other things.
ouhh, only one thing, I used a sphere to do the dropshield(with a sphere collider) and all is fine, but when you are inside the dropshield and you shoot the bullets goes really weird. $$anonymous$$aybe I know why but don't know how to solve it.
Neat! You could set the bullets to a different layer when you are inside or outside of the shield.
Your answer
![](https://koobas.hobune.stream/wayback/20220612131518im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make Sprite not Bounce on Collision (2D) 6 Answers
Object with rigidbody bounces after hit. 0 Answers
Disable bouncing effect 0 Answers
Internal collisions 1 Answer
how to change physics material of a colider in runtime 5 Answers