- Home /
CN Controls Joystick Issue
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.
Your answer

Follow this Question
Related Questions
CN Controls Joystick 1 Answer
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
3d camera control 3 Answers