- Home /
please help island demo compieler error
OK i'm new to unity i have a question i cant find out i try to load the game but i have compiler errors the console say's
Assets/Scripts/UnderwaterEffects.js(23,46): BCE0022: Cannot convert 'UnityEngine.GameObject' to 'float'.
what do i do
Well, presumably it's because you're trying to use a GameObject as a float. Could you show the line of code in question? Anyone can see what the error is from the message, but it's hard to tell you how to fix it without more specifics.
var waterLevel : float;
i never changed anything that is how i downloaded it but what do i change this to
The island demo was written for Unity 2 and isn't compatible with Unity 3 without hacking around at some stuff, which you probably don't want to do if you're new.
There isn't a new one, just look at something else like the Boot Camp demo.
Answer by hanskarlsson · Sep 18, 2012 at 12:50 AM
My cheap shooting-from-the-hip tape-and-glue solution was to comment out the lines that gave me an error, and I could successfully compile and run the Island demo.
It's not the optimal solution, of course, but I'm new to Unity and not sure yet how to properly fix those errors. :)
Answer by DriFtys · Feb 03, 2014 at 06:50 PM
find the line which says: if(water) waterLevel = water.gameObject; and replace the following: if(water) waterLevel = water.gameObject.position.y; i hope it will works else delete the script... im new to unity so (comments removed)