I have made this script ```using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMoveSc : MonoBehaviour
{
public float moveSpeed;
public float jumpForce;
public Rigidbody2D rb;
private Vector2 movement;
private void Update()
{
float horizontal = Input.GetAxisRaw("Horizontal");
// float vertical = Input.GetAxisRaw("Vertical");
movement = new Vector2(horizontal, 0);
if(Input.GetKeyDown(KeyCode.Space) && rb.velocity.y == 0)
{
Debug.Log("Should JUmp");
rb.AddForce(Vector2.up * jumpForce, ForceMode2D.Impulse);
}
}
private void FixedUpdate()
{
rb.MovePosition(rb.position + movement.normalized * moveSpeed * Time.fixedDeltaTime);
}
}