If Statement error

Hello,

I’m going through a basic tutorial given to me by a friend so that I may help him teach it over the weekend. I’m having a couple of issues with one of the scripts found in his instructions.

Here’s what I have for the code:

If(Input.GetButtonDown("Jump"))                                Unknown Identifier 'If', (BCE0005)
	{
	var theCube = GameObject.Find("Cube").transform;
	GetComponent(FollowCamera).target = theCube;            Unknown Identifier 'FollowCamera', (BCE0005)
	}

I typed this out as written, but why am I getting the errors above?

If you are going to be teaching people this stuff, you should make sure you know what your’e doing (this is probably more a comment to your friend since I assume he wrote the code to start with)

Using GameObject.Find in an update function is a huge no no. Teaching bad habbits is far from ideal… anyway, thats enough of my ‘do the right’ thing rant…

As for the other problem. It means there is no class called FollowCamera. In laymen’s terms, there is no script in your project called FollowCamera.

It also means that If isn’t capitalized…

haha, I totally glazed over the If error.