Why is print only in MonoBehaviour (and not using UnityEngine(?
Specifically, if you don’t inherit from MonoBehaviour but still have using UnityEngine
this statement won’t work: print("hi");
and you have to use Debug.Log("hi");
Why is print only in MonoBehaviour (and not using UnityEngine(?
Specifically, if you don’t inherit from MonoBehaviour but still have using UnityEngine
this statement won’t work: print("hi");
and you have to use Debug.Log("hi");
Print is a wrapper method that calls Debug.Log. Its a static member of MonoBehaviour. So it can be called from within a MonoBehaviour. If you have a real problem with Debug.Log you can still use print like so:
MonoBehaviour.print("This lets me avoid typing Debug.Log");