- Home /
Make a quad glow on collision?
I want to have a glow effect when a block collides with something in my game, but I'm unsure how.
Ideas?
I literally just want a brief 0.5s glow in a customisable colour.
easy : change to another material with a glow shader for specified time
technical : have a custom shader and toggle the glow effect
Answer by Owen-Reynolds · Dec 22, 2013 at 09:05 PM
That's three/four smaller problems:
o How to make a box glow. As alucardj wrote, maybe hand-make a glow material for the box. Or look up glow effects. You might have a SpotLight that turns on.
o How to turn the glow on/off. This is going to depend on how the glow is made. Won't be too hard.
o How to change color in a material (or a light, etc... .) This can be looked up.
o How to do something on a collision. Look at OnCollisionEnter examples and rigidbodies. Some use tags (or names) to check what hit them (like only bullets, or anything but the floor.)
o How to time 1/2 seconds. Mostly a programming problem. Also can be looked up. Coroutines work, but are tricky. Standard trick is something like: glowOffTime = Time.time+0.5f;
set when the glow turns on. Then, when Time.time>glowOffTime;
turn off the glow.
Your answer
Follow this Question
Related Questions
Detecting the Green in a Material's Color on Collision 1 Answer
Creating ship energy shields effect 2 Answers
Set Gameobject a certain color based off of other game objects 1 Answer
Changing a Game Object's RGBA Value on Collision (JS) 1 Answer
Finding color of a body at the point of collision with another body? 1 Answer