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.

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.