{
public Rigidbody2D rb;
public float speed;
public SpriteRenderer spr;
public Animator animator;
private void Start()
{
rb = GetComponent<Rigidbody2D>();
spr = GetComponent<SpriteRenderer>();
}
private void Update()
{
float move_x = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(move_x * speed * Time.deltaTime, rb.velocity.y);
}
}