Forum rules - please read before posting.

"Hotspot: Change interactn" doesn't disable Player action "Walk to marker" after disabling Hotspot

edited December 2020 in Technical Q&A

Not a big deal, but it seems when using "Hotspot: Change interaction" and setting a Hotspot to disable an interaction ("Interaction to change: Use", "Change to make: disable"), the Player action doesn't disable also. It seems to default to "Walk to marker" also, even if previously something like "Turn to face" was set.

If it helps, here's a screenshot of the Unity layout and info, and gif of it in action.

Could be a misunderstanding on my part and not a bug, but I would appreciate clarification. thanks

Comments

  • There's a difference between the Hotspot being disabled, vs its individual Interactions being disabled.

    What you're seeing is the "fallback" behaviour in the event that a Hotspot is active, yet has no valid interaction.

    If you want to prevent the Hotspot from being interactive at all, use the Hotspot: Enable or disable Action to disable it completely.

    This process can actually be automated through script, whereby toggling a Hotspot's interaction with Hotspot: Change interaction causes the Hotspot to turn off automatically if all of its "Use" interactions are disabled, or turn it on if any of them have been enabled:

    using UnityEngine;
    using AC;
    
    public class AutoEnableHotspot : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnHotspotSetInteractionState += OnHotspotSetInteractionState; }
        private void OnDisable () { EventManager.OnHotspotSetInteractionState -= OnHotspotSetInteractionState; }
    
        private void OnHotspotSetInteractionState (Hotspot hotspot, AC.Button button, bool isOn)
        {
            if (isOn)
            {
                hotspot.TurnOn ();
            }
            else
            {
                foreach (AC.Button useButton in hotspot.useButtons)
                {
                    if (!useButton.isDisabled) return;
                }
    
                hotspot.TurnOff ();
            }
        }
    
    }
    
  • Thanks for the info, cheers!

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.