Creating a simple character controller (Script provided)

I want a very simple character controller, a character that moves around in all directions and faces the direction he’s moving in. But I’m confused about how to achieve that, I find vector3 stuff confusing in general. How would I make this code use force and clamp the speed of the character’s movement and have him keep on facing the direction he’s moving in. Right now after he stops moving the rotation is reset.

public float speed;
    bool canPlayerMove = true;

    void Start()
    {
    }

    void FixedUpdate()
    {
        float moveHorizontal = -Input.GetAxisRaw("LeftJoyStickHorizontal");
        float moveVertical = Input.GetAxisRaw("LeftJoyStickVertical");

        if (canPlayerMove)
        {
            Vector3 movement = new Vector3(moveVertical, 0.0f, moveHorizontal);
            transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(movement), 0.15F);


            transform.Translate(movement * speed * Time.deltaTime, Space.World);
        }
    }

Hello buddy, this doesn’t work with forces but fixes you current code. Someone else would have to tell you about how to change this to use forces.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
 
public class scr : MonoBehaviour {
 
    bool canPlayerMove = true;
 
    public float speed = 0.0f;
 
    void FixedUpdate()
    {
        float moveHorizontal = -Input.GetAxisRaw("LeftJoyStickHorizontal");
        float moveVertical = Input.GetAxisRaw("LeftJoyStickVertical");
 
        if (canPlayerMove)
        {
            Vector3 movement = new Vector3(moveVertical, 0.0f, moveHorizontal);
 
            if (movement != Vector3.zero)
            {
                transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(movement), 0.15F);
            }
 
            transform.Translate(movement * speed * Time.deltaTime, Space.World);
        }
    }
}