Player moving really slow?

followed and check all my code about 20 times and still can not find the problem, I have my Main camera under my player Capsule
with this code attached to the capsule

var walkacceleration : float = 5;
var cameraObject : GameObject;
var maxwalkspeed : float = 20;
@HideInInspector
var horizontalmovement : Vector2;

function Update () 
{
	horizontalmovement = Vector2(rigidbody.velocity.x, rigidbody.velocity.z);

	if (horizontalmovement.magnitude > maxwalkspeed)
	{
        horizontalMovement = horizontalmovement.normalized;
        horizontalmovement *= maxwalkspeed;     

	}
    rigidbody.velocity.x = horizontalMovement.x;
    rigidbody.velocity.z = horizontalMovement.y;
	
	transform.rotation = Quaternion.Euler(0, cameraObject.GetComponent(MouseLookScript).currentYrotation, 0);
	rigidbody.AddRelativeForce(Input.GetAxis("Horizontal") * walkacceleration, 0, Input.GetAxis("Vertical") * walkacceleration);
}

These are the exact same as a person’s tutorials and I still have no idea what is wrong, the player barely moves

What’s the mass of the rigidbody? Did you change it from the default of 1? Maybe try using AddForce as apposed to AddRelativeForce.

I kept it at default of 1 and the guy said it was better to addrelative force :frowning: I follow him exact, so i have no idea why mine barely moves

Tried changing the mass, it speeds it up but will not hit “max” speed :frowning: still stumped

try supplying the forcemode parameter to AddRelativeForce.

experiment with the different types.

You could try playing around with the top bit of your script, for example:

var walkacceleration : float = 10;
var cameraObject : GameObject;
var maxwalkspeed : float = 45;

This should increase the speed of the character without having to put many physics options on your capsule.

Aye I tired this ^ the player moves faster but still wont “accelerate” to get upto the maxwalkspeed