Archive | December, 2011

Unity3D #pragma strict Gotch

I was working with some code in a book today and could not figure out why a variable was giving me problems.

Unknown idenifier: ‘mesh’. (BCE0005)

I don’t usually program using JavaScript much less with MonoDevlop, so it took me a while.  Turns out, it’s a little thing:

#pragma strict

I was using it, and the book wasn’t.  They didn’t declare the variable in the example unlike ALL the other ones! That’s why it is unknown, it IS unknown.  The sample code that came with the book compiled because it doesn’t have the #pragma strict.

2011 Indie of the Year

Indie of the Year Awards
GO VOTE NOW!