- Home /
Changing a GUI texture while hovering over an object?
I have a cube, and I want the cursor (which is a GUI texture situated at the center of the screen) to change textures as it hovers over it. The GUI texture is not parented to the cube, because there are going to be multiple cubes.
Comment
Answer by robertmathew · Apr 21, 2011 at 08:00 AM
var male : Texture2D; var ren : Renderer; //IS THE CUBE WHERE YOU WANT CHANGE THE TEXTURE
function OnGUI()
{
ren.renderer.material.mainTexture = male;
}