Dener
New Member
Posts: 3
|
Post by Dener on Apr 23, 2017 2:17:04 GMT
Hello guys. On the Unity forum, I saw a person asking for a way to put the main camera to not be destroyed on load while using the shake extension. A simple way to do that is this one: Add this script to your camera. using UnityEngine; public class DontDestroyOnLoad_Script : MonoBehaviour { void Start () { if (gameObject.transform.parent == null) { DontDestroyOnLoad (gameObject); } else { DontDestroyOnLoad(gameObject.transform.parent); } } }
Use it on the Start Method to work properly. I hope it can help someone
|
|