Forum rules - please read before posting.

Make the player jump with mouse double click

Hi Chris,

I am making the game in 3D direct format.
And I want the player to jump by mouse double click.
I see the default with AC is pressing the space button to make the player jump.
Is there any easy way to switch the way by double click to make the player jump in AC.
Thanks a lot.

Comments

  • The default is space because Unity's Input manager has a "Jump" input mapped to this button. Remove the Jump input to prevent the space key causing this.

    To have the Player react to double-clicks, attach this to your Player object:

    using UnityEngine;
    using AC;
    
    public class DoubleClickJump : MonoBehaviour
    {
    
        private void Update ()
        {
            if (KickStarter.playerInput.GetMouseState () == MouseState.DoubleClick)
            {
                if (!KickStarter.stateHandler.IsInGameplay ())
                {
                    return;
                }
                KickStarter.player.Jump ();
            }
        }
    
    }
    
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.