Answers for "unity 2d joystick controls"

C#
0

unity 2d joystick controls

public Joystick joystick;

private Vector3 input;
public float Speed = 5f;

private void Update()
    {
        input = new Vector3(joystick.Horizontal, joystick.Vertical);
        Vector3 velocity = input.normalized * Speed;
        transform.position += velocity * Time.deltaTime;
    }
Posted by: Guest on May-05-2020

C# Answers by Framework

Browse Popular Code Answers by Language