1

Heyy I am learning Unity developpemnt engine , but when I try associate my script to my sprite I got this error : Unity Error CS0103 : the name 'input' does not exist in the current context , my code is very simlpe ,

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Playermovement : MonoBehaviour {

    public float speed;
    private Rigidbody2D myRigidbody;
    private Vector2 change;

            void Start() {
        myRigidbody = GetComponent<Rigidbody2D>();
    }
           void Update() {
        change = Vector2.zero;
        change.x = Input.GetAxis("Horizontal");
        change.y = input.GetAxis("Vertical");
        Debug.Log(change);
            }                                                                                            
    }

So did somebody has the answer to my question ? I would accept any help thanks !

I am using ItelliJ IDEA to edit my C# scripts and Unity 2019.3.8f1 personnal

1
  • the tag you used is c but the code is c# I corrected. Commented Jun 9, 2020 at 14:27

1 Answer 1

1

Cause you use input, instead of Input!

Care with capital letters!

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.