- Home /
Is there any way an object can pass through another object that has a rigidbody and collider attached?
Basically I have a bullet thats meant to hit an enemy and take away points from their health. It works. BUT . The enemies have a vision cone attached directly in front of them(Im making a Stealth game). So when the bullet shoots it hits the cone and just stays still. The vision cone has a rigidbody and a boxcollider attached to it and is used for detecting the player. If I disable the collider the bullet can pass through but the enemy cant detect the player.
So is there a way I can have the bullet pass through the vision cone despite having a collider and rigidbody attached?
Thanks
Stealth
Answer by Digital-Phantom · Mar 17, 2015 at 06:03 PM
make the vision cone a trigger (is Trigger checked) and your bullets will pass though it.
Put the cone and bullets on different layers, then make sure those layers cannot interact with each other.
I know how to make layers but how do I make sure they can't interact with each other
Edit -> Project Settings -> Physics. There you see a bunch of checkboxes which indicate wether two layers can register collisions.
Your answer
Follow this Question
Related Questions
Javascript 2DRaycast help 0 Answers
Bullet Behavior with bounce without loosing speed when bounce with another objects. 1 Answer
An opinion on a bullet code 1 Answer
Bullet isn't moving forward 1 Answer
how to have bullets produce particles? 2 Answers