Hello Community,
I'm having a small issue with hotspot detector.. in my current scene, I do not wish to place the hotspot detector as a child of the player. instead, I want to assign the detector at the start of the scene when the player is spawned.
Is that achievable?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The Player's Hotspot detector can be assigned through script:
I tried something like this.. I got on error saying "does not exist in the current context"
How can I get it to pick the detector on start? Do I have to name it myHotpotDetector?
I would be grateful if you could help me fix this
You need to declare "myHotspotDetector" as a DetectHotspots variable:
Place this above the Start function, and it will then be exposed as a field you can assign in your Inspector.
Do be aware, though, that you don't need to spawn your Player into the scene - if you place the Player prefab in the scene file itself, AC will use this local instance instead, and you can assign the local Hotspot Detector to them as well. This may be easier than relying on a script to update the spawned Player instance.
You are a life savior, I appreciate it!
Yes, I was aiming for this, but I since I'm using "player switching," I don't believe it would work..
That's correct, in that case. Player-switching requires AC to handle all player-placement duties.