Hi I’m trying to achieve an effect so when you mouse over an object it either glows or becomes unlit. I’m sure it has something to do with shaders but I’m not sure exactly how this would be achieved. Any help would be amazing.
You can use raycast to detect if mouse is over the object, then simply change the shader of material.
function Update(){
var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if (collider.Raycast (ray, hit, 100.0)) {
hit.collider.gamObject.renderer.material.shader=Shader.Find( "Self-Illuminated Diffuse" );
}
}
Look here: http://unity3d.com/support/documentation/Components/shader-SelfIllumFamily.html
This is a starting point.
Change gameObject.renderer.material.color