Search Unity

Help me my code won't work and i'm new to codeing

Discussion in 'Unity Remote Config' started by RosadoX23, Jan 23, 2021.

Thread Status:
Not open for further replies.
  1. RosadoX23

    RosadoX23

    Joined:
    Jan 23, 2021
    Posts:
    1
    this stupid error keeps poping plz help it reads " 'Input' does not contain a definition for 'GetKey' "




    using UnityEngine;
    public class PLayermovement : MonoBehaviour{
    public Rigidbody rb;
    public float forwardForce = 2000f;

    // this is FixedUpdate because unity likes it more
    void FixedUpdate()
    { // lol forward force go brrrrrrrrrrr
    rb.AddForce(0, 0, forwardForce * Time.deltaTime);
    if ( Input.Getkey("d") )
    {
    // if a specifect thing does a specifect thing than this code will do a specifect thing
    rb.AddForce(500 * Time.deltaTime, 0, 0);
    }
    }
    }









    that is the code plz help thank you
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
Thread Status:
Not open for further replies.