- Home /
how do you destory an object with light??
hey guys, im makinga fps i have a flash light that turns on and off but i need help with something, i want to make a object die aka destory when its hit by the flashlights rays, aka the beam, so i turn it on its aimed at the object and it destorys...ive tried using on collision with tag but it doesnt work....
Answer by raimon.massanet · Jan 08, 2014 at 10:50 AM
I don't think you can destroy an object with a light. But I don't think you need to anyway... Try ray casting!
Ray casting it is! The length of the ray would be the range of the flash light.
Assu$$anonymous$$g that the beam of light has some non-trivial diameter to it, spherecasting is probably more appropriate.
You could also use a mesh collider if you make a mesh that fits the size and shape of your light cone.
Answer by sath · Jan 08, 2014 at 03:30 PM
http://forum.unity3d.com/threads/165305-SpotLight?p=1130007&viewfull=1#post1130007
http://answers.unity3d.com/questions/24662/detect-lightshadow-falling-on-object.html
http://answers.unity3d.com/questions/26099/how-to-detect-if-a-gameobject-is-hit-by-a-light.html
Your answer
Follow this Question
Related Questions
Light Baking Problem 0 Answers
How To Make Objects Appear Lit Without Using Lighting 2 Answers
Removing objects from an array 2 Answers
Ignore all lighting except for one (HDRP) 2 Answers
Removing a class object from a list(.remove not working) C# 1 Answer