Forum rules - please read before posting.

Double-clicking hotspot little issue

Hi everybody,
AC 1.74.5 and Unity LTS 2020.3.25f1.

We used many times the option "Trigger Interaction Instantly" in double-clicking in the hotspot to teleport a character directly to another scene, but we noticed a little issue. Here the situation: we have a "exit hotspot" (a door). In the hotspot we have a marker to reach the hotspot (for non double click situations), while in Use Interaction a simple fade out of the camera and a scene switch. So it's all ok, with double clicking character vanishes from the point where he is but, before switching, character re-appears for a little time. We solved changing the AC script, but, everytime we upgrade AC we have to change it. So, if it could help other developers, we preferred to report it.

Comments

  • edited January 2022

    When you say the character is "re-appearing for a little time", you're referring to the Hotspot Marker?

    What code change were you making? Are you looking to have the Player vanish completely, or not move from their original position?

  • Thank you Chris, I confirm that character appears for a while in the hotspot marker. Could I share here the PlayerInteractions.cs file with our changes?

  • PM them in private, but I'm trying to understand your intent. Where do you wish the Player to be instead of the Hotspot Marker? At their original position, or hidden from view?

  • Thanks Chris. I sent you a PM. The intent is, when the player makes double click, character, from position where he is, turn him to the hotspot then scene changes (but the character doesn't vanish to re-appear in the Hotspot Marker).

  • Thanks for the PM.

    I'll need to make a change in the next release, but with that release this script should serve the same purpose:

    using UnityEngine;
    using System.Collections;
    using AC;
    
    public class DoubleClickNoTeleport : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnDoubleClickHotspot += OnDoubleClickHotspot; }
        private void OnDisable () { EventManager.OnDoubleClickHotspot -= OnDoubleClickHotspot; }
    
        private void OnDoubleClickHotspot (Hotspot hotspot, Button button)
        {
            PlayerAction oldPlayerAction = button.playerAction;
            button.playerAction = PlayerAction.DoNothing;
            StartCoroutine (RevertButton (button, oldPlayerAction));
        }
    
        private IEnumerator RevertButton (Button button, PlayerAction oldPlayerAction)
        {
            yield return null;
            button.playerAction = oldPlayerAction;
        }
    
    }
    
  • Thank you very much

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.