I'm making a game where the player can fly via
static var jumpHeight = 8;
static function fly (){
GetComponent.().velocity.y = jumpHeight;
}
which is being called by
if (Input.GetKey (KeyCode.Space))
{
if (MainScript.flying == true)
{
FlightScript.fly ();
}
}
However, when I press space, I get an error reading:
InvalidProgramException: Invalid IL code in FlightScript:fly (): IL_0008: ldarg.0
I have absolutely no idea what this error means or what is causing it. All I know is that whatever is causing it is keeping my game from working. If anyone has any experience with this error please tell me how to fix it.
↧