- Home /
Raycast hits multiple targets
I have to seperate box colliders next to eachother, which are very little and supposed to activate lights, but however when i try to select a single one of them they both activate! aargh! help!:P
thanks in advance!
Comment
Answer by Leuthil · Mar 27, 2014 at 01:51 PM
If you only want the raycast to hit a particular collider, you can look into using Layers so the raycast ignores the one(s) you don't want to hit.
If you just want it to return the first collider it hits then just use Raycast instead of RaycastAll.
It's hard to say exactly how to do it because I'm not sure exactly what you're trying to accomplish. There may even be a better way to do it without raycasting.