Forum rules - please read before posting.
Tech questions during the weekend? Drop in on the community Discord channel!

Bug: Highlight executed although hotspot is disabled

I set a hotspot to ignore raycast which I think is the recommended way to disable it. The hotspot icon will not appear. The highlight for the linked object will still be done though, which is incorrect as the object should not react yet.

Comments

  • Can't recreate.  What are your Interaction and Hotspot settings?
  • I think I found the reason. It is not possible to actually disable hotspots in the editor. Setting the layer to IgnoreRaycast is not enough. One has to set the private flag isOn as well to false. Why is that? The interaction cannot be triggered if the hotspot is on ignoreRaycast. Why execute the highlight then? I think the check for isOn should either go or the flag made public. Or am I misinterpreting the code?

    I changed the isOn() method in hotspot.cs to my suggestion and that seems to solve the issue:

    public bool IsOn ()
    {
    if (gameObject.layer == LayerMask.NameToLayer (KickStarter.settingsManager.deactivatedLayer))
    {
    return false;
    }
    return true;
    }
  • To disable Hotspots in the Editor, attach the RememberHotspot script and set the Hotspot state on start to Off.
  • It's a bit strange way but it works! Thanks a lot :-)
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.