In the end i figured my issue was I took the shortcut
var myNumber = 0.0; as a cheat in javascript
but when i changed it to var myNumber : float = 0.0; it didn’t have the issue. Seemed to be picking it up as an object because I didn’t explicitly declare it.
I just want to point out that not the OP made that error in the code, but whoever wrote the “IslandDemo” or whoever wrote the 3.4 version of Unity. It is weird to see official demos not working anymore with new versions of the program.
Sadly, that is not really true with Unity. And I have also posted a wishlist item for this. Internally Unity has an implicit bool cast for UnityEngine.Object and whatsoever. Since I am not familiar with Unity Script I only know from real JavaScript that converting bool into float should be possible. So I would say that this type conversion could have worked in Unity 3.3 by doing Object->Bool->Float…
But since 3.4 they made typing stricter in US, so that this will fail now, I suppose…
BTW, this is terrible coding practice anyway, so its at least some sort of improvement that this fails now!