I put an event System in the Persistent Object Prefab.
Now It works
The post about the Null Reference helped me here and Brian with where to persist for furture no problems
I put an event System in the Persistent Object Prefab.
Now It works
The post about the Null Reference helped me here and Brian with where to persist for furture no problems
Yes, this one catches a lot of folks.
Ordinarily, when we create a Canvas for a UI, an EventSystem is automatically created in the scene (but not as part of the Canvas itself). Since our UI Canvas lives in the Core Prefab (which is a good place for it, so that we can drop a Core Prefab into any scene and instantly have our UI, Player, Camera, etc), Unity doesn’t automatically create an Event System. Because of this it’s often forgotten.
You can put it in the Persistent Objects Prefab, or you can put it in the Core Prefab. Either way (but not both) should work.
I put it into the HUD
prefab. Would there be any possibly downside or issue further down the project with that?
I actually keep it in the Core which contains the Hud anyways.
The only potential downside of using the Hud is that in the final course of the series we make a main menu with the Core, but generally we don’t want the Hud in that scene, so if it’s in there and you delete it, you may wonder why your menus don’t work. This caught a few students early on.
Since the HUD is part of the Core, I’d rather just deactivate it…
But then, we’ll see, and moving the EventSystem
around is easily done…
Yeah, if you do deactivate it, you’ll deactivate the Event System too, so you’ll have to move it at that point.
Good point!
Thanks.