- Home /
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.
Answer by Rachan · Jan 26 at 01:53 PM
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
Your answer
Follow this Question
Related Questions
CN Controls Joystick Issue 0 Answers
Dual virtual joysticks not anchored to the bottom of the screen 0 Answers
Joystick Sideways Movement 0 Answers
How do I controll a Character using the Mecanim Animator with Player Joysticks? 2 Answers
Look at issues 1 Answer