Forum rules - please read before posting.

Animated hotspot cursors

Hi Chris,
We have a feature where players can toggle to view all hotspots in a scene. We would really like to use an animated icon for this but I cant figure out how to do it or if it is possible using AC only. Right now I can only choose the use icon or a texture in the Hotspot section under Settings. I can see in the cursor tab that it is possible to animate cursors in general.

I was hoping you could point us in the right direction how to solve this.

Comments

  • Currently, you'd have to rely on a custom script to play an animation at the position of each Hotspot.

    Having the ability to animate the Hotspot icon in the Settings Manager is a fair suggestion, though - I'll give it some thought.

  • Alright thanks for the feedback!

  • I can confirm this'll be included in the next release.

  • edited April 2021

    In case anyone is looking for a solution right now I have made something really simple.

    public class ShowHotspotIcons : MonoBehaviour
    
    {
        public GameObject animationObject;
        private Hotspot[] hotspots;
        private List<GameObject> flames;
    
    
        void Start ()
        {
            hotspots = FindObjectsOfType (typeof (Hotspot)) as Hotspot[];
            flames = new List<GameObject>();
    
            foreach (Hotspot hotspot in hotspots)
            {
                var position = hotspot.transform.position;
                GameObject myInstantiatedGameObject = Instantiate(animationObject);
                myInstantiatedGameObject.transform.position = position;
                myInstantiatedGameObject.SetActive(false);
                flames.Add(myInstantiatedGameObject);
            }
        }
    
        void Update ()
        {
    
            if (!KickStarter.stateHandler.IsInGameplay () || Input.GetButtonUp ("HighlightAll"))
            {
                SetHighlights (false);
            }
    
            else if (Input.GetButtonDown ("HighlightAll"))
            {
                SetHighlights (true);
            }
        }
    
        void SetHighlights (bool show)
        {
            flames.ForEach(flame => flame.SetActive(show));
        }
    
    }
    
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.