using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float speed;
Rigidbody rb;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
{
// storing player's input
float input = Input.GetAxisRaw("Horizontal");
print(input);
//moving player
rb.velocity = new Vector2(input * speed, rb.velocity.y);
}
}
sorry, it's my first time posting in the forum.Please post your code as text in code tags, not as a screenshot. It is very difficult to read code presented that way on small devices, and adds an extra level of work that needs to be done if we want to try to reproduce the problem ourselves, or to highlight something about the code.
Anyway, from what I can barely read, it looks like you updated the velocity, but did not apply the velocity to compute a new position.