ClownfromSubang / G-man-Run-3

UAS
MIT License
0 stars 0 forks source link

Player Movement #3

Open ClownfromSubang opened 2 years ago

ClownfromSubang commented 2 years ago
  1. Left-Right Movement Menambahkan Movement atau kontrol gerakan keplayer private Rigidbody2D body;

    private void Awake() { body = GetComponent(); } private void Update() { body.velocity = new Vector2(Input.GetAxis("Horizontal") * speed, body.velocity.y); } }

  2. Changing Player Speed Menyesuaikan Speed yang dibutuhkan Player public class PlayerMovement : MonoBehaviour { [SerializeField] private float speed; }

  3. Implement Jump if (Input.GetMouseButton(0)) body.velocity = new Vector2(body.velocity.x, speed);