0 votes
by (8.2k points)

There are errors related to the name.

[21:31:18] Assets\scripts\playerControler.cs(16,28): error CS0103: The name 'input' does not exist in the current context

[21:31:18] Assets\scripts\playerControler.cs(16,56): error CS0103: The name 'movementSpeed' does not exist in the current context

[21:31:18] Assets\scripts\playerControler.cs(17,26): error CS0103: The name 'input' does not exist in the current context

[21:31:18] Assets\scripts\playerControler.cs(17,52): error CS0103: The name 'movementSpeed' does not exist in the current context

Assets\scripts\playerControler.cs(16,28): error CS0103: The name 'input' does not exist in the current context

public class playerControler : MonoBehaviour

Charactercontroller characterController;

public float movmentspeed = 5;

// Start is called before the first frame update

void Start()

charactercontroller = GetComponent<Charactercontroller>();

// Update is called once per frame

void Update()

{

float horizontal= input.GetAxis("Horizontal") *movementSpeed; float vertical = input.GetAxis("Vertical") *movementSpeed;

charactercontroller.Move (transform.forward* vertical + transform.right* horizontal);

}

by
Accedez a une interface intuitive et profitez d’un divertissement sans interruption avec <a href="https://cluny.fr/pgs/888starz-casino-telecharger.html">888starz Casino application</a>. Disponible sur Android et iOS, ce logiciel vous permet de jouer ou et quand vous voulez, avec des options de paiement securisees et des transactions rapides. Rejoignez la communaute des maintenant !
ago by
ago by
ago by
Теперь вы можете наслаждаться игрой в любое время, просто установив <a href="https://888starz-rus.site/">888starz Casino для iOS</a>. Это приложение разработано для игроков, которые ценят удобство, быструю скорость загрузки и стабильную работу без зависаний. Попробуйте мобильную версию и оцените все ее преимущества!
ago by

1 Answer

0 votes
by (8.2k points)

All these errors,  I can say that these errors are occurring as you are not using UPPER CASE and LOWER CASE alphabets of all your variables.

void Update()

    {

        // player movement - forward, backward, left, right

        float horizontal = Input.GetAxis("Horizontal") * MovementSpeed;

        float vertical = Input.GetAxis("Vertical") * MovementSpeed;

        characterController.Move((transform.right * horizontal + transform.forward * vertical) * Time.deltaTime);

        // Gravity

        if (characterController.isGrounded)

        {

            velocity = 0;

        }

        else

        {

            velocity -= Gravity * Time.deltaTime;

            characterController.Move(new Vector3(0, velocity, 0));

        }

    }


     float horizontal = Input.GetAxis("Horizontal") * MovementSpeed;

        float vertical = Input.GetAxis("Vertical") * MovementSpeed;


Kindly Correct both the lines.

TechXR runs courses in AR / VR / Metaverse / Game Development. Some of the popular Q&A in our courses are available here for easy discovery.

113 questions

117 answers

140 comments

114k users

...