Is this possible?
My script changes the color of my player but I’d like it to change the color of anything hit that has a tag of “placedObject” also a few seconds afterwards to change the color back to normal. Could anyone help me with this? thanks.
function Update (){
if(Input.GetMouseButtonDown(0)){
var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Physics.Raycast (ray, hit, 10.0)){
if(hit.collider.tag == "placedObject"){
var renderer : Renderer = hit.collider.renderer;
renderer.material.color = Color.yellow;
print ("hitObject");
}
}
}
}