- Home /
Why is my character so slow?
My character is super slow, even if I set the speed to "100f" it doesn't change the speed of the player at all! The code I'm using is in a script in my "FirstPersonPlayer" which consists of a main camera and a cylinder. Below is my player movement script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovementScript : MonoBehaviour
{
public CharacterController controller;
public float speed = 20f;
// Update is called once per frame
void Update()
{
float x = Input.GetAxis("Horizontal");
float z = Input.GetAxis("Vertical");
Vector3 move = transform.right * x + transform.forward * z;
controller.Move(move * Time.deltaTime);
}
}
Any help would be greatly appreciated. Thank you!
Thanks for raising this question. I am also facing the same issue
Answer by Llama_w_2Ls · Feb 12, 2021 at 08:02 AM
You are not multiplying your move direction with your speed value. Therefore the value does nothing. This line should be:
controller.Move(move * speed * Time.deltaTime);
Answer by mr_multi · Feb 12, 2021 at 06:26 PM
controller.Move(move speed Time.deltaTime);
you forgot to add speed if you do that it will work becous currently you have a public float called speed i guess you had it in your mind or followed a tutorial and just forgot that step,@Scratch472 controller.Move(move speed Time.deltaTime); you forgot to add speed if you do that it will work
Bru. I literally just said that above.. This is a useless comment.
Your answer
Follow this Question
Related Questions
Limiting Speed on Two Axis 1 Answer
character(ball) rolls with less speed when I build it 2 Answers
Character moves slower after build 3 Answers