GetButtonUp is not a member of Input

I just started learning Unity and, I came across this code which I want to try. When I finished the it ends up: Assets/Input.js(3,19): BCE0019: ‘GetButtonUp’ is not a member of ‘Input’.

This is my code

#pragma strict
function Update(){
    if (Input.GetButtonUp("Jump")){
        Debug.Log("Done!");
    }
}

Docs say it is a member. Assuming you have it spelt right.

Unless you have another class running around called Input.

Maybe you have another script in your Project you named also Input and unity is accessing the wrong class ?

1 Like

the code you posted, is it in an class you named Input.js ?.. you shouldn’t name classes like Unity classes unless you are using namespaces

2 Likes

if you very much have to have a script called “Input” in your project you’ll need to call the unityengine Input class with the namespace explicitly, i.e.

UnityEngine.Input.GetButtonUp(...

because you have a local class called Input it’ll assume you are talking about that, not the unityengine one. (not even sure unityscript allow this though! :()

of course the simplest solution is to call your script something else like “PlayerInput” or “InputHandler” or whatever.

oh and a poll? really?

1 Like

A common noob mistake. They assume because there is a poll field on the bottom of the create thread page thy means they have to use it.

Oh and for the record the question is meaningless. Everyone knows I know everything.

lol