Hi
I’m sorry for a noob question, but I’m fighting with it for some time already.
I’ve got a simple code on one object:
// Use this for initialization
void Start()
{
gameObject.SetActive(true);
gameObject.renderer.enabled=true;
}
void Awake()
{
renderer.enabled=true;
gameObject.SetActive(true);
}
// Update is called once per frame
void Update ()
{
if (Input.GetMouseButtonDown(0))
{
ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast(ray,out hit))
{
if (collider.name == "start")
{
starting = true;
}
}
}
else if (Input.GetMouseButtonUp(0))
{
starting = false;
}
if (discount.animEnd)
//gameObject.SetActive (false);
renderer.enabled=false;
//Destroy (gameObject);
}
After level reload using “Application.LoadLevel(Application.loadedLevelName);”, the object is not visible. Also in Inspector the renderer on the object is disabled.
Thanks in advance