Very new to scripting. Trying to get pieces of a character to glow when selected(clicked). My current script works when placed individually on the objects, however, I would like one script on one object: either the parent or camera (whatever is best for these situations). When I do this is does not sense the children being clicked upon at all(nothing happens), and my research isnt finding me that clear missing piece to the script.
So you are aware how I am getting the glow: it is the “glow” image effect and I am switching the material on my character from a texture with no alpha to one with.
My bare script:
using UnityEngine;
using System.Collections;
public class textureglow : MonoBehaviour {
public Texture glowtexture;
void OnMouseDown() {
//changes begining texture with no alpha to a texture with for glow effect
renderer.material.mainTexture = glowtexture;
Debug.Log ("pressed");
}