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

Game Development How to Make a Video Game Player Input and Cameras Make a Follow Camera

Can't add field that stores transfer component

At 3:16, under the Follow Camera Script, I can't import the Player into the Camera script, there is no player option, only script.

3 Answers

You have to type [SerializeField] or something like that above it.

Oh, this was confusing.

I managed to drag the the Player (Transform) after I added the [SerializeField], like Bill Merickel suggested. In the video Nick drags it before writing the field so I got a little lost there :) All good now.

Add this before trying to drag:

[SerializeField] private Transform player;

Thanks Bill!

Never mind, my mistake.

How did you fix it?