I’ve been working on this for quite a long time. I’m familiar with unity but working on my C# skills. These seem like they should be simple actions to do, but after days and nights looking at this script, it won’t work.
All I’m trying to do is display a scene with an active object, then show it for 40 seconds, hide it, and show a new object.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LoadWeatherShelf : MonoBehaviour {
//Todo
//Hide Object 1 after 40 seconds
//Display A new object
// Use this for initialization
void Start () {
Invoke("NextObject", 40);
}
// Update is called once per frame
void Update () {
}
void NextObject ()
{
GameObject.Find("PrimarySceneContent").SetActive(true);
}
Any help is appreciated!
,I spent a lot of time working on this nights and days and hours and still can’t get this to work right. It’s some dumb mistake I’m sure.
I’m simply trying to deactivate one object (not destroy), after a set duration 40seconds, and then turn on another object that is de-activated. I’ve tried so many varieties. Nothing works.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LoadShelf : MonoBehaviour {
//Todo
//Hide Object 1 after 40 seconds
//Display A new object
// Use this for initialization
void Start () {
Invoke("NextObject", 40);
}
// Update is called once per frame
void Update () {
}
void NextObject ()
{
GameObject.Find("PrimarySceneContent").SetActive(true);
}