Forum rules - please read before posting.

Disabling hotspot at the start

Hey there,

there's probably a simple solution to this and I just can't think of it. 
Basically, I have a fridge in my scene which opens when you click on it. Once it's open I would like the hotspots for closing the fridge and the item inside the fridge to become visible. Right now, they are visible even with the fridge closed. I used the Limited Visibility script on another object (wardrobe) but in that case there's a camera change which activates the visibility. How do I affect it without a camera change?

I hope this makes sense :)
Maria

Comments

  • Are you referring to the visibility of the mesh objects that the Hotspots represent, or the "clickability" of the Hotspots when the door is closed?

    If the former, you can use the Object: Visibility Action to change the visibility of any mesh.

    If the latter, you can disable a Hotspot by attaching the Remember Hotspot script to it and setting it's Hotspot state on start to Off.  You can then use the Hotspot: Enable or disable Action to turn it on when the fridge door opens.
  • Thank you so much for your quick response Chris! 
    The Remember Hotspot script sorted the issue. 

  • Me to! THANKS!

  • Hi, I've been using the "Remember Hotspot" Script, but have noticed that on occasion, the Hotspot "forgets" the setting. Even though the settings are correct, on entering playmode, the "Remember Hotspot" will not have an effect. I haven't been able to reproduce this consistently, and occasionally it seems to 'correct itself'. Has anyone experienced this issue?

  • @juanelo_dev What are your AC and Unity versions?

    A Hotspot's enabled state is determined by its layer - Default being "on" and Ignore Raycast being "off". Is there anything else that may be controlling its layer, and is the issue always with the same Hotspot?

  • Hi @ChrisIceBox . I'm using Unity 2019.3.3f1 & AC 1.71.6 (updated from 1.71.4 yesterday, as part of troubleshooting the bug)

    I don't believe I have anything else controlling the layers. Is there a way to check those layer settings through the Unity/AC UI, or would I need to query that via script? I've had it occurr to two different hotspots. They both get stuck in an 'on' state, regardless of the 'Remember Hotspot's 'Hotspot state on start' setting.

    I casually discovered that reverting the project back to a prior version on GIT, and then jumping back to the current commit seemed to temporarily solve the issue.

  • Is there a way to check those layer settings through the Unity/AC UI, or would I need to query that via script?

    Easiest would be to just check the Inspector as the scene starts. It may, on occasion, be set to "DistantHotspot" if you're using vicinity-based Hotspot detection.

    If it's being caused by the Hotspot or Remember Hotspot component, then the Hotspot script's TurnOff function will be called. Try placing this Debug statement in line 672 of Hotspot.cs:

    Debug.Log ("Turned off Hotspot " + name, this);
    

    If that shows for the Hotspot in question, share the message's full stacktrace from the Console so that we can see where it's coming from.

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.