Forum rules - please read before posting.

Question about PlayerMovement

Hi! 

Thank you for adventure creator.

Movement method :Point And Click 

At present, player move when I click mouse button: 'InputGetMouseButtonDown'(single click).
---------------------------------------------------------------------------

Is it possible that player move when I click mouse button: 'InputGetMouseButtonUp' ?

---------------------------------------------------------------------------
it's very important to me to develop mobile game.

Comments

  • The perceived state of the mouse button can be customised by way of delegate overrides - see the Manual's "Remapping inputs" chapter as well as this tutorial.  It would be possible to have "up" events register as regular clicks this way, e.g.:


    (Paste that into a C# script named ClickUpExample and add to the 3D Demo scene - you'll only be able to move when clicking up).

    If you're developing a mobile game, however, you won't make use of a mouse, so you won't be reading the mouse button state.

    For mobile games, the Input method should be set to Touch Screen in the Settings Manager.  "Clicks" are then replaced with "taps", and rely on Unity's Input.GetTouch methods.

    Currently it is not possible to override the percieved phase of a Touch - but I will add this in the next release of AC.  Thanks for the suggestion.

  • Thanks.  It is very helpful:).

  • edited September 2018
    Hi Chris!

    I have a problem.

    Remapping inputs is working great. 

    But when I use 'InputGetMouseButtonUp',

    I cannot use drag in GameCamera2DDrag.

    Is there any way to use 'InputGetMouseButtonDown' when I only use drag?


  • Since AC expects a click down, it'll check for that first before any drag state - since the drag relies on a click down first.

    Having click "ups" detected first creates a fundamental conflict between the two systems.

    What I can do, however, is adjust the GameCamera2DDrag script so that you can override the means by which it reads the "input vector" to control its movement.  That way, you can subclass it and write your own (simple) way of reading the mouse input without relying on AC's input system.
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.