CN Controls Joystick

Hi,

Now I’m using your CN Controls in my project 2D platformer.

I replace input to CnInputManager as state on CnControls and it works and the script as below:

void FixedUpdate()
{
//Walk & Jump
if (mPlayer && mHasControl)
{
if (CnInputManager.GetButton(“Jump”))
mPlayer.Jump();

        mPlayer.Walk(CnInputManager.GetAxisRaw("Horizontal"));

    }
}

However for crouch & sprint doesnt work because the script GetKeyDown & GetKeyUp were used as below :

void Update ()
{
//crouch & sprint
if (mPlayer && mHasControl)
{
if (Input.GetKeyDown(KeyCode.LeftShift) || Input.GetKeyDown(KeyCode.RightShift))
mPlayer.StartSprint();

        if (Input.GetKeyUp(KeyCode.LeftShift) || Input.GetKeyUp(KeyCode.RightShift))
            mPlayer.StopSprint();
           
        if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
            mPlayer.Crouch();

        if (Input.GetKeyUp(KeyCode.S) || Input.GetKeyUp(KeyCode.DownArrow))
            mPlayer.UnCrouch();
    }
}

I already try to replace input into the script as I did on walk and jump, but it’s shown an error.

Hopefully somebody can help me to solve this issue.

it use a lot of memory!! it just keep use a little bit memory But forever…
if you can wait and wait about 10 min or more and you can see until
your mobile game will stop working because of memory leaks!
now I’m still trying to fix this issue