Figured it all out.
I am trying to make a simple game where there is a GUI with two text fields and a button ... player enters in angle and force into the two text areas and presses the button to launch an object forward (in x-direction) with player defined angle and force.
I running into a few problems. First off here is what I have so far:
I getting this error when I attempt to launch the object:
"InvalidCastException: Cannot cast from source type to destination type. fire.Launch () (at Assets/fire.js:40) fire.OnGUI () (at Assets/fire.js:15)
Nothing happens, the object is never launched, but the game runs fine and the script compiles fine.
Any ideas on what is wrong? Sorry I am not the best programmer out there!!
In your Launch() function, try declaring your banana on a separate line, and defining it on the next line.
answered Apr 07, 2011 at 08:01 PM