Hotspots not drawn

Okay, without looking closer at an example project with the same issue, I can’t really give a definitive answer here.

My hunch is that when switching scenes, you are creating an instance of these hotspots in an initialise function of a script in the new scene. At this point, you might have both scenes loaded so it’s finding the old scene’s camera entity.

Once the new scene has fully initialised, the old scene is destroyed and the hotspots have an old reference to effectively an entity with all it’s components destroyed.

A cheat way to work around this is to use a unique name for the camera the hotspots are in or use a unique tag for the camera (eg hotspot-camera) and search by tag instead.

The other way would be to findByName on the scene root and not the app.root.

1 Like