ClownfromSubang / G-man-Run-3

UAS
MIT License
0 stars 0 forks source link

Animation #4

Open ClownfromSubang opened 2 years ago

ClownfromSubang commented 2 years ago
  1. Flipping player left-right Menambahkan printah Flip Layer ketika player bergerak, jika player akan bergerak ke arah kiri maka player akan diubah secara horizontal { if (horizontalInput > 0.01f) transform.localScale = Vector3.one; else if (horizontalInput < -0.01f) transform.localScale = new Vector3(-1, 1, 1); }

Selanjutnya menambahkan animasi pada karakter agar lebih menarik

  1. Idle Animation image

  2. Run Animation image

  3. Jump Animation image

ClownfromSubang commented 2 years ago
  1. Mengatur keluar masuknya animasi player yang sudah dibuat agar tidak bertabrakan image
ClownfromSubang commented 2 years ago
  1. Camera Follow Player public Vector3 offset = new Vector3(0f, 0f, -10f); private float smoothTime = 0.25f; private Vector3 velocity = Vector3.zero;

    [SerializeField] private Transform target;

    void FixedUpdate() { Vector3 targetPosition = target.position + offset; transform.position = Vector3.SmoothDamp(transform.position, targetPosition, ref velocity, smoothTime); }