Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Code not working

I'm using Unity 5.5.1 and when adding the code to FlyMovement.cs it supposed to add center with an inspector field for a transform component and it doesn't work. When switched back to Unity from MonoDevelopment i see the code in the inspector http://imgur.com/a/C3uxX . I'll also show the code in MonoDevelopment here http://imgur.com/a/Td5sB . I don't know if this has anything to do with it being a newer version or if i've put the code in wrong (i've put the code in a few times).

1 Answer

Henrique Vignon
PLUS
Henrique Vignon
Courses Plus Student 6,415 Points

But have you added the script to the fly prefab?

the serialized field will not show in the inspector when you just select the script, it'll show only when said script is added as a component to an object.