How do you make it so it rotate left and rotate right but not just left and just right,How do I make it so this code make it not just up down left and right but up down rotate left rotate right

,

i don’t know. i am just answering @Shadows9998 even know i am me

Firstly, please insert code using the Code Sample button. It makes it easier for us to read and to copy if we need to test it.

The Character Controller is a pre-built component and you cannot change it. If you want to build your own Character Controller, you will have to find a tutorial because it’s not easy to explain in a short answer. However, here is a simple Character Controller that I use when prototyping games. It needs a collider and a RigidBody. You may also have to tick the Freeze Rotation constraints in the RigidBody, if you are using a GameObject that rotates under force.

using UnityEngine;

public class RB_Move : MonoBehaviour
{

    [SerializeField] float playerMoveSpeed = 5;
    [SerializeField] Vector3 playerJumpForce = new Vector3(0, 5, 0);
    [SerializeField] float playerLookSpeed = 5;
    Rigidbody rb;
    Vector3 move;

    void Start()
    {
        rb = GetComponent<Rigidbody>();
    }

    void Update()
    {
        MovePlayer();
        JumpPlayer();
        LookPlayer();
    }

    private void FixedUpdate()
    {
        move.y = rb.velocity.y;
        rb.velocity = transform.TransformDirection(move);
    }

    void MovePlayer()
    {
        float x = Input.GetAxisRaw("Horizontal");
        float z = Input.GetAxisRaw("Vertical");
        move = new Vector3(x, 0, z).normalized * playerMoveSpeed;
    }

    void JumpPlayer()
    {
        bool jump = Input.GetKeyDown(KeyCode.Space);
        if (jump && IsGrounded())
        {
            rb.AddForce(playerJumpForce, ForceMode.Impulse);
        }
    }

    bool IsGrounded()
    {
        Vector3 origin = transform.position;
        Vector3 direction = -transform.up;
        float maxDistance = GetComponent<Collider>().bounds.size.y / 2 + 0.1f;
        return Physics.Raycast(origin, direction, maxDistance);
    }

    void LookPlayer()
    {
        float rotate = Input.GetAxis("Mouse X") * playerLookSpeed;
        transform.Rotate(0, rotate, 0);
    }
}