Forum rules - please read before posting.

Prevent cursor from changing icon when hovering a Hotspot with Single 'Use' Interaction

[Unity 2019.4.39f1 - AC v1.75.3]

Hi!

Is there a way to prevent the cursor from changing its icon into the Use interaction one, when hovering a Hotspot that has Single 'Use' Interaction? enabled?

A bit of context. We are catering for both point and click and direct control with a gamepad and, in "point and click mode", we are giving players options about how to interact with scene-changing Hotspots (in other words, exits).

We give them the option to either:

  • Single click to trigger interaction instantly
  • double-click to trigger interaction instantly
  • double-click to simply run to the Hotspot

In order to achieve this, I'm basically changing the Hotspot interaction type at runtime.

When in "point and click mode" and when an exit is set to have one of the abovementioned double-click interactions, in order to make use of the Double-clicking field of the Hotspot, I set hotspot.oneClick = true and the hotspot.doubleClickingHotspot accordingly.

A probably important disclaimer is: I currently can't alter much of my Hotspot detection code. Long story short being that, at the beginning of the project we were requiring multiple hotspot to be able to be shown and interacted with simultaneously and, although this is not the case anymore, hotspot detection still relies on part of that codebase.

I'm willing to provide more context if needed but, in the meantime, and as always, thanks a lot!

Comments

  • I'd need to see your Settings and Cursor Managers for full context - can you share screenshots?

    If you want the cursor to appear as it's "main" graphic, it may be easier to create a dedicated "exit" cursor type with the same icon and assign that to your Interactions.

  • edited May 2022

    Here are the 2 different Settings (for both Point and Click and Direct movement method) and the Cursor settings (some icons are still missing but it should be enough to get the idea!

    https://imgur.com/a/xJHCXN8 (Apologies in advance if some of the options make little sense relatively to what my issue currently is)

    All my Hotspots use the X interaction and I'm able to override that in the custom Unity UI for the Hostpot Popup, but of course not the for the cursor itself.

    What you suggested seems to be a good idea, though, even though this means going over all of the hotspots manually :sweat_smile: !

  • Set your Interaction method to Context Sensitive, uncheck Change cursor based on Interaction? in the Cursor Manager, then set it back to Choose Hotspot Then Interaction.

  • edited May 2022

    Alas, it is not working.

    Also, when switching to Context Sensitive the checkbox in the Cursor Manager is already unticked.

    Following your suggestion I also tried placing inside an Update() method on a component attached to the Player the following line: KickStarter.cursorManager.allowInteractionCursor = false; but to no avail.

    To provide more context: here's my UIHotspotPopup script, attached to all of the Hotspots https://pasteall.org/FyxY

    (The code is messy, one of the reasons being that I do all sorts of checks to make sure the Menu gets properly unregistered, but it sometimes still locks and carries forward between scenes)

    And this is my "WalkToExitChecker" script, attached to the "exit" Hotspots: https://pasteall.org/60kF

    The issue with the cursor happens when value of the variable checked in the Check() method is 0 (plausibly, being the only one that sets the hotspot.oneClick to true

    I hope this helps!

  • edited May 2022

    A correction: I actually realized I need hotspot.OneClick set to true for all of those options, in order to make use of the hotspot.doubleClickingHotspot!

  • Recreated - the cursor will change automatically under these conditions.

    I will look to see if this can be made optional, but my original suggestion earlier of changing the Hotspot's icon ID to an exit icon that uses the regular cursor should still apply. You can incorporate this into your script - no need to manually update Hotspot Inspectors.

  • Thank you for your help! I shall try and do that then, for the time being! :)

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.