- Home /
Question by
Alabatross · Oct 17, 2013 at 03:50 PM ·
raycastcollidertrigger
Make raycast pass through trigger and still register?
I'm attempting to add a bullet whiz sound effect for when a shot goes near you. To do this id create a spherical trigger around the player. What I want to do is, if the shot (a raycast) passes through this sphere, it will still continue on while making the player hear a whiz sound.
Is this possible? Can the raycast tell the difference between a trigger and a solid collider? Or do both stop it
Comment
A Raycast
only records a single hit. Because of the nature of a ray, it doesn't "stop" it, but only the closest hit is recorded. If you have raycast collision with triggers enabled, then yes, it will "stop" on the trigger.
To work around this, you should use RaycastAll
and evaluate it yourself :)