Hi guys,
i made this :
using UnityEngine;
using System.Collections;
public class Temps : MonoBehaviour
{
// Use this for initialization
void Start ()
{
}
public GameObject other;
// Update is called once per frame
void Update ()
{
for(int time; time < 4; time++)
{
if(time < 2)
{
gameObject.renderer.material.color = Color.red;
}
else if(time = 2)
{
gameObject.renderer.material.color = Color.yellow;
}
else if(time = 4)
{
gameObject.renderer.material.color = Color.green;
}
else if(time > 4)
{
Destroy(other);
}
}
}
}
and when i drag and drop this file in my unity object itâs says : " canât add component âTempsâ because it doesnât exist. check to see if the file name and class name match.
How can I solve that please.
Thanks for replying.