- Home /
The question is answered, right answer was accepted
How do I make bullets go through my collider?
Hello, I'm having trouble with my Player Detectors on my enemies. They have a sphere collider around them, detecting the player whenever he walks inside it. However, when I try to shoot the enemies, the bullets get caught on the collider, looking like it stops in mid-air. So, how would I make the bullets go through the sphere collider? Thanks :)
Change the bullet or Collider layer, and Change the Collision matrix.
See Layer-based collision detection
@SnowSmasher can you give the best answer or a +1 if the answer helped.
Answer by SirPizza13104 · Oct 08, 2016 at 04:09 PM
You could make the bullets have a trigger collision system so that they pass through it.
@Sergio7888 If you change the collision matrix then the bullets would not be detected at all, meaning you could not apply a damage if that's what you want.
Hope this helped.
@SirPizza13104 change the collision matrix make the bullets not detectable by sphere collider used as detector, not by the player collider, the usual pattern is have a object following, jointed, nested or parent to player to have the detection as trigger collider so changing the matrix is the more efficient way since it also reduce Physics calculation making the game faster.
Using a collider to detect things in the same object to the damage object reduce the level of control of the collisions and some times create a higher number of unnecessary Physics calculations making the game slower.
Okay well I'm sorry for giving you false information I just answered with the information I thought was correct. This was only my second ever answer on this site. Once again sorry @Sergio7888.
Follow this Question
Related Questions
Bullet Not Working 3 Answers
Making a bullet invinceble 0 Answers
Raycast shooting problems 1 Answer
Why do my bullets only destroy themselves sometimes after colliding with the wall? 0 Answers
C# OnCollisionEnter() problem 0 Answers