What is the best way to add glowing eyes

I am teaching myself how to create a point-and-click style game (kind of like Myst). For example, a player may click a suit of armor and the arms will raise when the player clicks on it. I can easily do this by triggering an animation.

However, what is the best way to make things glow. For example, if a player clicks on a painting of a man I want both eyes in the painting to become red (think of any old haunted house you’ve been to). Or if a player clicks on a crystal I want the crystal to glow a specific color.

What is the best way to achieve this? I know I need to ‘start’ something on the click event for the object, but should I be looking at adding particles to my game object to get the glow effect, should I be using animation to add the glowing eyes, should I be replacing the game object entirely with an identical version of the same game object but with the glowing parts already attached to the game object?

Any suggestions for a newb?

Thanks.

I continue to think about the best way to do this. I think I have a better solution. Going back to my painting on the wall example, if I create a game object of the painting, I can add two light components to the painting game object (one for each eye). I can disable the two light components and only turn them on at run time when the user clicks on the painting. I can then also trigger a count down using a loop when the player clicks on the painting to disable both light components after three or so seconds (maybe even increasing / decreasing the intensity of the light components to make the eyes appear to be becoming brighter and dimmer before they go out). I could do the same for any interactive game object in the game which requires a light source of some type when the game object is clicked.

Does this sound like the right way to go?

Yep, that sounds like a good solution. Write your script in such a way that it doesn’t know anything at all about the specific object it’s attached to, or what triggers it. Make things like the duration of the glow be public properties you can tweak. Now you can use this script wherever you need it — you’ve just created a nice reusable component!

This puts you firmly on the path to enlightenment. Faced with a problem, beginning programmers craft a solution specific to that problem. More seasoned programmers create a tool they can use to solve that problem, as well as lots of future ones (including ones they haven’t thought of yet). Even more seasoned programmers simply pull out a tool they already have, quickly apply it, and move on. :slight_smile:

1 Like

Thanks Joe!

Use an emissive material for the eyes, up the amount when a user clicks on it via a trigger. Nice and simple, add some bloom to make it look evil grrr!..

1 Like