Roll a Ball Camera issues

okay so I’m new to unity and I want to learn how to use it because… {insert various reasons here}
so I went to the learning page and saw the roll a ball tutorial and thought well I’ll be rolling a ball around on a square that looks easy enough and for the most part it was until I got to the part where I wanted the camera to move and I got the camera to move with the ball just like in the video except mine has error messages popping up on it
2229374--148505--Capture.PNG
see how ugly they are?
I hate them and the weird thing is the script works fine and it doesn’t prevent me from playing but when I do play it gives me these five messages and it’s even more annoying that two of them are duplicates this could maybe have something to do with the tutorial using C# and me using JavaScript? >.<
so basically I’ve been trying to figure out what’s wrong and finally I decided to ask the forums because someone will probably know

by the way here’s the code that’s (presumably) making these errors
thanks in advance :smile:

#pragma strict

var offset = Vector3.zero;
public var p = GameObject();

function Start () {
  offset = transform.position - p.transform.position;
}

function LateUpdate () {
  transform.position = p.transform.position + offset;
}
public var p = GameObject();

is wrong- if you’re trying to create a new GameObject, then it needs to be

var p : GameObject = new GameObject();

I think (I use C#). I suspect, however, that you just want it to hold a GameObject reference, in which case you don’t have to assign it to anything, just

var p : GameObject;

and that’s it. Then, you can just drag an object into that slot in the inspector so that it’ll be referencing it in the script.

thanks Lysander that cleared things right up!
I obviously still have more to learn about JavaScript because until I started using unity I hadn’t really seen variables defined using a colon 0_0 I saw it in C# and figured it was a C# thing I guess you can do it in JavaScript too I appreciate your time thank you :slight_smile: