Forum rules - please read before posting.

NPC Hotspot Disabled on Runtime

I have an NPC who's Hotspot is being switched off at runtime and I can't figure out why. I'm on Unity 6.1. AC 1.84.3

https://www.dropbox.com/scl/fi/6l9rnvm1f8kaugnbb05p1/NPCBeforeRuntime.png?rlkey=9vs7o3gyl1xjzyt47c37q8kvl&dl=0

https://www.dropbox.com/scl/fi/y2z99fov3bbch82829dnt/NPCAfterRuntime.png?rlkey=tz4fl0g8rxbpuz3vnet7c6kv1&dl=0

I can't see anything in the OnStart cutscene that would be turning him off and I even tried adding a Hotspot Enable at the end of the cutscene but he still remains disabled once the cutscene is finished.

https://www.dropbox.com/scl/fi/60dgghpq65rja7diwfz74/OnStart.png?rlkey=nwq56zr1ct6fqxfka4hf76f61&dl=0

Any ideas where I might look to find what is turning his hotspot off?

Many thanks.

Comments

  • Can you share a screenshot of the Hotspot GameObject in full?

    A Hotspot will be considered "off" if it is placed on the Ignore Raycast layer. Does it start the game on Default? Keep their Inspector open while OnStart plays to check at which point their layer changes.

  • Thanks Chris. OK, so the game object that has the NPC component on it is set to Ignore Raycast, but all of my NPCs seem the same so I presume that's normal. When I selected this characters Sprite child (that has the hotspot comonent), that was also set to Ignore Raycast, so I switched it to default to match the other NPCs. But the second the level begins, the layer switches back to Ignore Raycast, and when I stop the game it reverts to Default.

    https://www.dropbox.com/scl/fi/951jpld1bptn4tgx7t1a9/NPCHotspot.png?rlkey=czz5smkoxas6iam570hq9kmya&dl=0

    https://www.dropbox.com/scl/fi/h8a2bh7v4hz1tlddjzm1h/NPCHotspotRuntime.png?rlkey=1w70upgoucvxrtc9uj36vl2ro&dl=0

  • And if I switch it to Default during runtime it waits a couple of seconds and then flips back to Ignore Raycast.

  • edited August 25

    Might it be an animation issue, in that case? If it reverts after a couple of seconds, it may be that the layer is being set through animation.

    Try disabling the Animator component and see if it still occurs.

  • That's it. Brilliant. Was driving me mad. I had an animation event on his idle animation that was set to turn off his hotspot. I should have twigged because I had been experimenting in another level with turning his hotspot on and off at different times in his animation cycle but, it was on a completely different animation so I didn't put two and two together. Thanks for saving me from myself Chris.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.