Getting:> error CS0103: The name 'DontDestoyOnLoad' does not exist in the current context
from the following simple case:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Mission:MonoBehaviour{
private void Awake(){
DontDestoyOnLoad(this.gameObject);
}
void Update(){
}
}
Tried also "UnityEngine.Object.DontDestroyOnLoad(this.gameObject)" with the error:
> error CS0117: 'Object' does not contain a definition for 'DontDestoyOnLoad'
The file is in the open "Assets" folder.
Unity3d 2019.1.4f1 Windows
↧