Search Unity

Simple movements doesn't work in the beta

Discussion in '2019.3 Beta' started by ngomes007, Oct 13, 2019 at 1:13 AM.

  1. ngomes007


    Nov 19, 2017
    I coded simple movements and it said doesn't match name..
    Same file worked with 2019.1
    Does someone know why
    using System.Collections.Generic;
    using UnityEngine;

    public class charactercontrol : MonoBehaviour {
    public float speed = 10.0F;
    // Use this for initialization
    void Start () {
    Cursor.lockState = CursorLockMode.Locked;

    // Update is called once per frame
    void Update () {
    float translation = Input.GetAxis ("Vertical") * speed;
    float straffe = Input.GetAxis ("Horizontal") * speed;
    translation *= Time.deltaTime;
    straffe *= Time.deltaTime;

    transform.Translate(straffe, 0, translation);

    if (Input.GetKeyDown ("escaps"))
    Cursor.lockState = CursorLockMode.None;

  2. Peter77


    Jun 12, 2013
    Please post the exact error message the next time and please edit your post to use code tags.

    I tested it with Untiy 2019.1.14f1 and it outputs "ArgumentException: Input Key named: escaps is unknown" there too.

    "escaps" is not a valid key identifier for
    , you should take a look at the documentation:

    Supported key identifiers are listed at the bottom of this page:

    You probably meant "escape" instead. However, you could also use the
    enum instead, which gives a compile rather then runtime error, thus not as easy to make such mistake:
    Code (CSharp):
    1. if (Input.GetKeyDown(KeyCode.Escape))
    LeonhardP and vakabaka like this.