This is literally all the code I have:

var Target = Transform;
var distanceFromPlayer= 10;

function LateUpdate() {
transform.position = Target.position.GameObject + Vector3(distanceFromPlayer,0,0);
}

but I can’t get it function properly. I constantly get a ‘InvalidCastException’ error

Full error:
InvalidCastException: Cannot cast from source type to destination type.
(wrapper dynamic-method) UnityEngine.Transform.Transform$get_position$ (object,object)
Boo.Lang.Runtime.RuntimeServices.GetProperty (object,string)
UnityScript.Lang.UnityRuntimeServices.GetProperty (object,string)
Platformer Camera.LateUpdate () (at Assets/Platformer Camera.js:5)

Help please. :frowning:

Change var Target = Transform; to var Target : Transform;. You have been trying to assign Transform as the class, I figure you want a type reference to transform. This will make it pop-up in the inspector. To assign the transform of the current object do this:

var Target : Transform;
function Start () {
    Target = transform; // transform is the component, Transform is the class
}

Remove GameObject in transform.position = Target.position.GameObject.