|
Hi, I can't compile the following code inside Unity editor (unity 3.1 free, windows 7 HP). It says:
I can't understand what's wrong with it...
(comments are locked)
|
|
Your code as is is fine except the last line, which should be transform instead of Transform. Not entirely sure why it's complaining about _speed - try relaunching unity perhaps? Removing _speed references brings back an error that I need to have instance of Transform (e.g. transform) to get access to non static member Translate. Weird... May be this is the clue?
Jan 10 '11 at 08:04 AM
Bat2k
Yup, the code compiles fine for me changing Transform to transform
Jan 10 '11 at 08:27 AM
Mike 3
Strange, but I've changed transform to Transform because of error Assets/Movement.boo(13,9):BCE0005: Unknown identifier: 'transform'. No I got an error that an instance of Transform required to have an access to Translate method. This is expectable. But the error with transform/Transform may be the clue...? It seems that I'm missing something not related to the code itself... By the way since my code is ok, did you manage to compile it in your enironment?
Jan 10 '11 at 09:43 AM
Bat2k
Thank you, I'll try to experiment a little bit more. I can remember that there was no Transform issue before I added members of the class. I'll keep you posted in case I find what's wrong.
Jan 10 '11 at 09:46 AM
Bat2k
(comments are locked)
|
|
Ok, I recreated the project from scratch and it just works. No more variable/Transform issues. Perhaps you could edit your question by including what you did to solve it so people do not have to read all the posts ?
Mar 30 '11 at 11:01 AM
Ippokratis
I'm almost certain this problem was caused by a bug in Boo where it will not alert you of mismatched whitespace. Odds are, he was using spaces to indent one part (probably copy/pasted) and tabs to indent the last function [or vice versa]. Boo interprets this as Update being a standalone function — not a method of Movement. As a result, it's no longer in the class's scope and _speed is undefined.
Dec 05 '11 at 03:16 AM
ironmagma
(comments are locked)
|

Have your tried declaring the type? I don't know much about Boo, but do you need a type i.e. _speed as single = 5.0F
It doesn't help.