How do I create an Initial Spawn Point?

I am trying to get rid of an error that I am getting involving my character and camera. the first line of my code is the error. This is from my camera script

var Target = transform;

I saw a tutorial once a while back that said adding a spawn point will fix this error. But I can’t find that anymore so I am asking the community to teach me a bit about how to make a spawn point.

You can fix your error by breaking the assignment apart:

var Target;
Target = transform;

Or better yet:

var Target;
function Start() {
  Target = transform;
}

But reading through your code, I don’t believe either one is what you want to do. You want to do this:

var Target : Transform;

You can then drag and drop your player onto the ‘Target’ variable in the Inspector. Or you can find it:

function Start() {
    Target = GameObject.Find("Player").transform;
}

Note: variables should be named with a lower case first letter. This is the convention used my most of the programmers on this list, and it makes it easier for them to read and debug.

Ok, so your script didn’t work right for me either, but after some experimenting I did get it to work. Here is what I got

public var Player : Transform;
var distance = 10;

function Update(){
transform.position = Player.position + Vector3(distance, 0, 0);
}

This is a working, error free script for a 2D or 2.5D sidescroller. For anyone that needs a script for camera this one works flawlessly.