I’m using a script that plays audio Through multiple scenes and when i get to the “Game” scene i want the object to destroy itself… I don’t know how to acomplish this… But i thought it would be something like this.
Make a new script… Place it into a blank gameobject in the Game Scene…
using UnityEngine;
using System.Collections;
public class StopMusicOnGameScene : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
GameObject.Find("AudioThroughScene");
Destroy (gameObject);
Destroy(this);
}
}
But as you can see this wont work because its deleteing the gameobject itself before it deletes the AudioThroughScene Object… How can i acomplish this?
I’m new to Scripting Sorry.