How can I display text and change color of objects when I roll over them with the mouse?

Hi I am new to Unity3D and don't know how to solve this problem. I am making a product demo and where you can rotate the product and explain what different parts do.

On one side of the screen will be a vertical list of parts e.g. 1.Nut 2.Washer 3.Case 4.Switch etc. 5... In the center of screen will be the product which can be rotated in 3D. At the Bottom of screen will be a text filed explaining what each part does.

What I need help to do is make the Parts list interactive.

That is to say when I put the cursor over the name of each part i.e. 1.Nut the text changes color (highlights) at the same time the 3D part (mesh) changes color and also text explaining the function of the part appears at the bottom of the screen. The camera and 3D model are not a problem I just need make interactive parts list work. If anybody can help I would really appreciate it. I am using Java script.


First, make sure that you add a collider component to each part which you want to be an active rollover.

Next, add a GUI Texture GameObject to your scene (from the GameObject menu). Rename it to "Rollover Text Display" (exactly, case sensitive).

Now create a new Javascript script, name it "RolloverItem", and paste this in:

var rolloverText = "";
var rolloverColor =;
private var originalColor : Color;
private var textDisplay : GUIText;

function Start() {
    originalColor = renderer.material.color;
    if (rolloverText == "") { rolloverText =; }
    textDisplay = GameObject.Find("Rollover Text Display").guiText;

function OnMouseEnter() {
    textDisplay.text = rolloverText;

function OnMouseExit() {
    textDisplay.text = "";

Finally, add this script to each object that should have rollover text. If you don't specify some text in the "Rollover Text" field for each item, the object's name will be displayed. You can so adjust the rollover colour.