Forum rules - please read before posting.

Action List Assets and Hotspot

Is there a reason Hotspot Examine Interactions cannot use Action List assets? I have many identical objects in my game, and for their Hotspot's Examine Interaction I was planning on using an Action List asset to display narration text, so that I didn't have to re-write it for every one of the objects individually.

Comments

  • There's no such restriction - any Hotspot button can run an asset file, just set the Hotspot's Interaction source to Asset File.

  • That's right, but the problem is that I want the hotspot's use interaction to be In Scene, but the examine interaction to be Asset File. I think the only way around is to either write the descriptions for every hotspot, or use a menu.

  • The field is per-Hotspot, but you can hook into the OnHotspotInteract custom event to fire off an ActionList asset when one from a list of Hotspots is examine:

    using UnityEngine;
    using System.Collections.Generic;
    using AC;
    
    public class RunAssetOnExamine : MonoBehaviour
    {
    
        public List<Hotspot> hotspots;
        public ActionListAsset examineAsset;
    
        private void OnEnable () { EventManager.OnHotspotInteract += OnHotspotInteract; }
    
        private void OnDisable () { EventManager.OnHotspotInteract -= OnHotspotInteract; }
    
        private void OnHotspotInteract (Hotspot hotspot, AC.Button button)
        {
            if (hotspots.Contains (hotspot) && hotspot.lookButton == button)
            {
                examineAsset.Interact ();
            }
        }
    
    }
    
  • Thank you. What I did (before I saw this reply) was just have the examine interaction have a single action: call an action list asset to do the same thing (show narration text). This also avoids having to write the text again.

  • Bump.

    While minor, being able to choose the source per interaction would be quite nice, imo. I have the nearly the exact same use case as above.

    A "switch" almost always has scene based Use action (as what it does is about that switch).
    However the examine interaction is almost always shared between all switches, and thus a action list asset.

  • Update: Actually, having 2 Hotspot components on the same GameObject - one hotspot using assets lists for its interactions (my custom interactions), and the second hotspot (with different interactions from above,- just Use) and referencing a scene based action list seemed to work at first.

    However Im now seeing bugs when I attempt to run a interaction on the hotspot from another action list.

    Its late here and I cant accurately reproduce/summarize the issue (i know the above is vuage)- so quickly:
    Are two Hotspot components on the same gameobject supported or not recommended? if it should work, ill look into this more tomorrow and reproduce what im seeing.

  • edited August 9

    Are two Hotspot components on the same gameobject supported or not recommended?

    I'd advise against it. While you could drag the intended component directly into Action fields that reference them, the interaction system will only associate one Hotspot for a given GameObject.

    The Event Runner should be a viable workaround for this. The "Hotspot / Interact" event can be used to run an ActionList asset whenever an Examine interaction is run - even if the Interation field itself is unassigned.

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.