This is my player movement script:
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerMovement : MonoBehaviour
{
Vector2 moveInput;
Rigidbody2D myRigidbody;
[SerializeField] float runSpeed;
void Start()
{
myRigidbody = GetComponent<Rigidbody2D>();
}
void Update()
{
Run();
}
void OnMove(InputValue value)
{
moveInput = value.Get<Vector2>();
Debug.Log("moving");
}
void Run()
{
Vector2 playerVelocity = new Vector2(moveInput.x * runSpeed, myRigidbody.velocity.y);
myRigidbody.velocity = playerVelocity;
}
}
But the player is still behaving very weirdly when falling. It is not following gravity⌠Unless gravity is the gravity of a small asteroid.
EDIT: The gravity setting is the same as it ever was. -9.81, the default value. Altering it does nothing
EDIT 2: The instance and the prefab have Gravity scale set to 1.