Forum rules - please read before posting.

Hotspots started to always run Use interaction before Inventory interaction.

I created a new scene, and I've noticed that when I use an Item on any hotspot with both Use and Item interaction, the simple Use interaction executes instead, and the proper Item interaction executes only on the second click with the item.

In previous scenes, this does not happen, and the Item interaction executes properly on the first click. I don't know how this happened, as I am not aware of doing anything differently. When I remove the use interaction from the hotspot, the Item interaction executes just fine.

I am using a custom Interaction method (kindly provided by you, Chris).
Please help.

Comments

  • It's been too long since I provided that, you'll need to remind me of it's current state.

    Also, if this doesn't occur in other scenes, it sounds like there's a difference in the way it's been set up. Where are you placing the interaction method script involved?

  • edited January 21

    My mistake, I thought it had something with custom drag camera script. But it is more likely connected to Unity UI cursor that i am using, right? In that case it is CstomCursorAnimator script:

    using UnityEngine;
    using AC;
    
    public class CustomCursorAnimator : MonoBehaviour
    {
    
        public Animator animator;
        public string cursorIDParameter = "CursorID";
    
        void Update()
        {
            var hotspot = KickStarter.playerInteraction.GetActiveHotspot();
            if (hotspot && hotspot.IsSingleInteraction())
            {
                var useButton = hotspot.GetFirstUseButton();
                animator.SetInteger(cursorIDParameter, useButton.iconID);
            }
            else
            {
                animator.SetInteger(cursorIDParameter, -1);
            }
        }
    
    }
    

    Also, this started to happen when I added a lot of new items. They have the same setup as the original ones. But each has two versions for desktop and mobile. Im not sure if it is connected tho.

  • This script only deals with the appearance of the cursor - it should have no bearing on the running of interactions.

  • What should I look for? The Custom Drag Camera Script?

  • edited January 22

    It has been a long time, but I believe you asked me to set the Interaction Method to Custom script so the CustomDrag Camera script would work. It is however weird that it acts up only in one scene. I did check, and I didn't find any difference in the Scene settings (not that there is much to set), nor cameras.

  • The script is set to run a Hotspot's Inventory interaction only when an Inventory item is selected. Otherwise, it'll run the Use interaction. Both will occur when the mouse/touch is released.

    How are Inventory items selected?

    Where it the script placed, and if you disable it upon approaching the Hotspot, are any Interactions able to run without it?

    If it's working in all other scenes but this one, there must be some difference, even if it appears minor. It could be the presence of an Event System object, or a local Player that prevents the default one from spawning.

  • So I just discovered that when I disable "walk to marker", the hotspot starts behaving properly. Could this be some kind of a bug?

  • Possibly, but given the custom code involved it's hard to say where it would lie.

    Is that to say - when the issue occurs - the Use interaction runs only once the Player has walked over to the Marker?

    And does this mean that no other Hotspots in other, working, scenes have "Walk to Marker" set?

    It's still possible that there's another factor involved. See my questions in the post above.

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.