Open ClownfromSubang opened 2 years ago
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); } }
Changing Player Speed Menyesuaikan Speed yang dibutuhkan Player public class PlayerMovement : MonoBehaviour { [SerializeField] private float speed; }
Implement Jump if (Input.GetMouseButton(0)) body.velocity = new Vector2(body.velocity.x, speed);
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);
}
}
Changing Player Speed Menyesuaikan Speed yang dibutuhkan Player public class PlayerMovement : MonoBehaviour { [SerializeField] private float speed; }
Implement Jump if (Input.GetMouseButton(0)) body.velocity = new Vector2(body.velocity.x, speed);