Changing the look or color of an object at runtime can be a very effective way of letting players know that they can interact with it. This is very useful in a number of game genres, such as puzzles and point-and-click adventures, and it can also be used to create 3D user interfaces.
In this recipe, we'll swap materials when the mouse is over an object by using a second material showing a border:
Figure 5.17 – The interactive cube rollover highlight effect we'll create in this recipe