Question by
Hadongee · Sep 12, 2015 at 04:22 PM ·
javascriptraycastrenderertransparency
Raycast : Changing hit material back to its original transparency after the ray leaves it.
Currently in my game I have a shot out from that player that, on collision with an object sets its transparency to a certain amount. However, I need to allow the object to change back to its original un-transparent state once the ray leaves it. Any idea on how to do this?
Comment
Answer by hexagonius · Sep 12, 2015 at 08:43 PM
shoot a ray constantly if the first object capable of the change was hit change and save it. as long as you raycast against it, do nothing anymore. the first time you hit nothing or something else, set it backand the saved reference to either a new changeable object or null.