Checkpoint Scripting Help

I have one script on a sphere with a sphere trigger collider. This is the script:

function OnTriggerEnter (other : Collider) {

PlayerCheckpointScript.checkpoint = transform.position;


Then I have this script on the First Person Controller:

static var checkpoint : Vector3;

function Update () {


static function death() {

transform.position = checkpoint;


I am getting this error:

An instance of type 'UnityEngine.Component' is required to access non static member 'transform'

Please help.

It is due to the fact. That the death function is static and doesn’t know which player script to reference. I presume that there is only one so you should probably make a static variable on the script with the death function that you set to this during awake an use that to access the transform.


static var current  : NameOfThisScript;

void Awake() {
    current = this;

static void Death() {
    current.transform.position = checkpoint;

Or you could then make Death non-static and call it through current.