OnMouseEnter/OnMouseExit Help

So, I’m new to Unity and Javascript, but I thought I understood what these did pretty well. … Anyway, I’m making a main menu and I have 3 3D Text objects with box colliders on them and this script.

function OnMouseEnter(){ renderer.material.color = Color.grey; }

function OnMouseExit(){ renderer.material.color = Color.white; }

It’s extremely simple, and yet, it’s doing all kinds of weird stuff. One of the objects doesn’t change at all. One of them will always flicker colors rapidly when you hover over the object and the other works at first, but after a few seconds will also flicker. Is there something about 3D Text that makes this not work? Because I can’t think of any other way this wouldn’t work.

Btw, I’ve also tried replacing OnMouseEnter with OnMouseOver and tried C# (because this scene is a part of a project that uses C#) but neither changed anything.

Try using “gray”, rather than “grey”

Grey is fine; see the docs. Anyway if grey didn’t work it would just be a syntax error.

Try making a new blank scene with nothing in it except a camera and one object with that script attached once, and see what happens.

–Eric

I figured it out after awhile. I had created a plane to try to make a background and it’s mesh collider was interfering with the others somehow. But, I decided I’m just going to use a GUI instead.