I've got a strange issue with unity. I know similar topics have been posted, but I've scoured the forums, answers, and the unity web page for an answer without success.
Everything works properly in the editor... but for some reason I can't get the following code to work in standalone or web:
This script is applied to a game object with one child, designated "spinnerBox" as its tag. In the editor, it spins, in standalone, it does nothing. I've also tried to use:
...which has the exact same effect.
I'm very impressed with unity's feature set so far and I'd really love to continue developing with it, but this issue is killing me. Thanks for any help in advance!
asked Jan 29 '10 at 05:02 AM
If this is in Update, then you want
because otherwise it's framerate-dependent. Although it would be better to do
and set up the appropriate variable, so you can easily change the speed.
answered Jan 29 '10 at 05:38 AM
The main difference that shows up between builds and the editor is the order in which scripts are executed.
I would check very carefully that your awake and start calls are executing in the order you think they should. If indeed it is exactly what you've posted above that isn't working, I don't see anything wrong.
answered Jan 29 '10 at 01:38 PM
Have you looked in the output log when running the game? Except indeed what Eric5h5 says I can't see anything wrong directly but it's hard to say much from two lines of code. If the spinnerbox can't be found, there should have been an exception and this is written in the output log.
If the code is from the update function, it's quite expensive to do a find every update. Better make a global variable and do the find part in the Start function or instead of a find.
answered Jan 29 '10 at 06:07 AM
I'm having the exact same problem.
I posted it here: http://forum.unity3d.com/viewtopic.php?t=55264
It seems that my build code will not work with any new .js scripts I create. Once I've copied an pasted in tutorials work fine. Anything I do in the editor also works in the editor (but exclusively in the editor) this is not limited to transformations but to sounds, destroying objects etc.
Does anyone have an answer to what's going on?
answered Jun 19 '10 at 12:51 AM