Hi,
I’m a month old to Unity, but not new to programming. I created a class in my GameManager script and am trying to create an object of that class in my PlayerController script. This is as far as I have gotten:
public class PlayerController : MonoBehavior {
private GameManager.Boundaries boundariesClass;
void Start() {
boundariesClass = GameObject.Find("Game Manager").GetComponent<GameManager.Boundaries>();
}
}
I have been able to use functions from getting the GameManager script this way, and I can even access methods inside of the Boundaries class using boundariesClass.customMethod, however I have been struggling how to simply create a class of type Boundaries:
Boundaries myBoundaries = new Boundaries();
I swear I have done my research and have come up empty handed (everything I find is about creating objects from a class that is in the same script the object is being created in). Thanks in advance.