|
So, I have this script that I had, but then began modifying. Since it was in C# (it was originally not mine, I just used it to start off(I'm mostly new to Unity, and development in general, although I have worked much with 2D before and have very quickly familiarized scripting syntax)), I had a bit of trouble adding my own spread modifier. I chose to convert it to UnityScript, so that I would be able to more quickly do things with it. I haven't been able to test it, but I can work all translating kinks out after I fix this. I'm on the very end:
But when it compiles in Unity, the only error is this: Assets/My Assets/Scripts/Gun.js(509,34): BCE0043: Unexpected token: .. Line 509 being "function ShowHits(RaycastHit.hit)", the problem is the period between RaycastHit and hit, but there shouldn't be. There were no problems with other instances of RaycastHit.hit and RaycastHit.hits in the script, so, considering this just bewildered me, does anyone know what's going on here? (I have looked and looked around, not finding an answer, so don't flame me if I'm blind)
(comments are locked)
|
|
You need to define the type of variables used in functions. That creates a whole slew of errors from the entire script. I'll look through them, but it seems that alot of things relied on that line being structured how it was o_O
Apr 24 '11 at 04:51 AM
taylorsnead
"The name 'string' does not denote a valid type ('not found'). Did you mean 'Boo.Lang.Compiler.IO.StringInput'?" is the error for 4 of them, with different names. They are all "does not denote a valid type"
Apr 24 '11 at 04:52 AM
taylorsnead
The line had incorrect syntax, so nothing relied on it; you're just seeing the other errors that were already there. There's no 'string' in JS, it's 'String', but that's not related to the error in question.
Apr 24 '11 at 05:27 AM
Eric5h5
Ah, thank you for clearing that up. Sometimes I just get effed with capitols and finite syntax like that. I guess I'm just a sucky translator.
Apr 24 '11 at 05:35 AM
taylorsnead
(comments are locked)
|
