using UnityEngine; public class DropletMovement : MonoBehaviour { private Rigidbody2D rb; <<<<<<< HEAD ======= public float moveSpeed = 5f; public float jumpingPower = 5f; private Vector2 movement; private Animator playerAnim; //for animation private float xInput; >>>>>>> 3a4d5de (current correct code inshallah) public float moveSpeed = 5f; public float jumpingPower = 5f; private Vector2 movement; void Start() { rb = GetComponent(); } void Update() { movement.x = Input.GetAxisRaw("Horizontal"); if (isGrounded && Input.GetKeyDown(KeyCode.Space)) { rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpingPower); } } private void FixedUpdate() { rb.linearVelocity = new Vector2(movement.x * moveSpeed, rb.linearVelocity.y); } }