Forum rules - please read before posting.

Component-based "Mouse Down Event On Hotspot" listening Action?

For instance, there is a TV set prefab with custom scripts for changing channels with the mouse. I put a Hotspot component on it so it's useable in AC. OnClick would TurnOffAC () and kickstart the custom scripting. And vice versa.

I know this is easy to do in Playmaker or Bolt (let alone pure C#), but that is not the point. Could a native AC "Hotspot listener" facilitate matching AC Hotspots with external assets/scripts? For non-coders or poor coders I mean.

Comments

  • For now, I just included using AC in the TV's own script (resolving ambiguity with System.Action), then turned off AC at Awake.
    But I wonder if there could be a less involved way, solved from Inspector.

  • edited October 2022

    You can use the Engine: Manage systems Action to selectively disable AC aspects, but turning it on or off completely will need to be done externally, i.e. via a custom script.

    What is the specific use-case that requires AC to be turned off fully? Are you looking to turn it off for a set time, while a non-AC interaction runs?

    For "OnClick" functionality without involving Interactions/ActionLists, you can set the Hotspot's Interaction source to Custom Script, which then lets you specify a GameObject and function to call when an interaction is triggered.

  • "What is the specific use-case that requires AC to be turned off fully?"

    In one case, it's a radio set with mouse-based scripts, as seen on the pic.

    I'm trying but cannot get AC to temporarily give up its cursor handling for these scripts. So the cursor remains stuck mid-screen, as is normal with AC in this game. I cannot seem to be able to hook into its Cursor Manager exclusively. But your Interaction source suggestion might solve this.

  • edited October 2022

    What is the locked state of the cursor during normal gameplay, and what are your Cursor Manager settings?

    If you disable the Cursor and Input systems, AC shouldn't control the cursor any more - it might just be a case of having to unlock the system cursor:

    Cursor.lockState = CursorLockMode.None;
    
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.