Forum rules - please read before posting.

Mouse clicking on hotspots simultaneously clears existing subtitle and plays new interaction?

I was wondering if there was a way to adapt mouse-click function so that when I click on an interactive area with a subtitle still on screen I can both clear the subtitle and play the interaction simultaneously? Currently with my setup this only clears the subtitle and I need to click again to run the interaction.

I was also wondering whether it was also possible to double click on an inventory element and have the player sprite run, in the way they do when double clicking on the nav mesh?

Thank you! 

Comments

  • edited November 2018
    When a mouse click has an effect, it's "consumed" by that effect so that only one thing is affected per-click.  When the speech is skipped with the LMB, the click is consumed so that another click is required to interact.

    This is by design, and not something I think other users will want changed.  You can, however, remove this restriction by opening Speech.cs, and removing/commenting out the instances of the line:

    KickStarter.playerInput.ResetMouseClick ();

    Double-clicking an inventory item also isn't something that makes sense to most games, since the inventory is part of the player so there isn't normally a place to have them run to.  Are you referring to the general list of item's the player is holding, or a list of items usable on the currently-selected Hotspot (i.e. in the Interaction menu)?  Details to illustrate what you mean might make it more clear.

    You may be able to achieve such behaviour through custom script: if your Menu relies on Unity UI, you can have a double-click handler on the Button and get the Player to run somewhere through custom script:

    AC.KickStarter.player.MoveToPoint (myTargetPosition, true, true);


  • Thank you so much! :) This works great.

    My menu currently uses AC but I will look into Unity UI. 

    I'm using arrow menu elements at the bottom of the screen to exit rooms. These run an asset file action script which checks which room the player is in before changing scenes. The player then moves to point whilst the camera fades out. I was previously using hotspots to do this (with an arrow cursor change on rollover), but it wasn't clear how to exit rooms so I changed to arrows.

    Thank you
  • There's no need to rely on Inventory items for that - regular Button elements can do that.

    If you want to have the player change scene after reaching their destination, it'll make more sense to have an ActionList run instead of a custom script.  Double-clicking functionality can come later, but the commands to make the player run and change scene should be done with Actions.

    To avoid having to do a Scene: Check Action before a separate Character: Move to point Action for each scene, you can create an e.g. "Left Exit Marker" prefab that you drop into the scene to have it work in all cases.

    Create a regular Marker in the Scene Manager, make it a new prefab, and attach a Constant ID component to it.  Check Retain in prefab? in its Inspector, and then assign that in the Character: Move to point Action.  When that Action runs, the Player will then move to that Marker so long as an instance of it is in the scene.  For more on this technique, see these tutorials.
  • Thank you for this! Sorry, I meant to say actionList instead of action script! I currently use an ActionList to check the scene, and then call an interaction within the scene to tell the player to move to a marker whilst the camera fades out and the scene changes. 

    I've used a button element in the past but I was unable to get the run on double click functionality working. Is there a way to achieve this with a button element? 

    Thank you
  • Not through the Menu Manager, but if your Menu relies on Unity UI then you can create a custom script that listens for double-clicks and attach it to your UI Button.  (Also be sure to unlink this Button from AC so that AC doesn't do anything with it)

    There's a fair number of posts about this on the Unity forums - this one, for example.

    When you've detected a double-click on the Button, you can then run an ActionList asset manually by triggering its Interact function.
  • Awesome! :) Thank you very much for your help.
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.