- Home /
Input.GetButtonDown Unknown member
I'm not seeing a fire effect happen so I put a breakpoint in to see and the debugger is giving me a Input.GetButtonDown Unknown member: GetButtonDown error at the if with Input.GetButtonDown. This seems to happen intermittently. When I go to the declaration of Input, it seems to be right (with a GetButtonDown), but
void Update () {
if (canThrow) {
if (Input.GetButtonDown("Fire1")) {
.
.
.
}
}
}
Answer by Eric5h5 · Sep 13, 2012 at 05:07 PM
I guess you called your class Input, and since your Input class doesn't have a GetButtonDown function, Unity doesn't know what you're talking about.
No, the class is called CoconutThrower. Input is built into the Unity Engine:
using System; using System.Runtime.CompilerServices; namespace UnityEngine { public sealed class Input { . . . public static extern bool GetButtonDown (string buttonName); [WrapperlessIcall ] . . .
Your answer
