Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Invalid IL code error when calling static function

$
0
0
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.

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>