Player Moviment Witch Joystick Script
I'm trying to create the player's movement by joystick, all my movement and player configuration is in the player.cs file, and in that part I'm trying to add the joystick and I'm not getting it, does anyone help me?
// simple WSAD movement without prediction
Vector2 lastDirection;
float horizontal;
float vertical;
[Client]
void WSADHandling()
{
// don't move if currently typing in an input
// we check this after checking h and v to save computations
if (!UIUtils.AnyInputActive())
{
// get horizontal and vertical input
// note: no != 0 check because it's 0 when we stop moving rapidly
if(useJoystick) {
horizontal = joystick.output.x;
vertical = joystick.output.z;
}
else
{
float horizontal = Input.GetAxis("Horizontal");
float vertical = Input.GetAxis("Vertical");
}
ERROR:
Player.cs(65,9): error CS0246: The type or namespace name `joystick' could not be found. Are you missing an assembly reference?
Line Error:
//joystick
public joystick Joystick;
public bool useJoystick = false;
Comment
Your answer
Follow this Question
Related Questions
how to fix automatic camera rotation when using joysticks? 0 Answers
Multiple Joysticks activating both scripts 0 Answers
Switch joystick and gyroscope 0 Answers
Game Kit Controller - no input 0 Answers