|
EDIT Figured it all out. ORIGINAL 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!! Thanks!!
(comments are locked)
|
|
In your Launch() function, try declaring your banana on a separate line, and defining it on the next line.
I'm not a JavaScript developer. So if this works, I cannot explain why it needs to be done like that. Hopefully a JS guru can come explain it. =) Not quite ... I am starting to think my problem is with the object I have it attached to.
Apr 07 '11 at 08:19 PM
SlapnutsGT
"declaring your banana" lol
Apr 07 '11 at 10:52 PM
ThomasQ
(comments are locked)
|
