"BCE0019: 'SetActive' is not a member of 'Object'. " and others

i have errors in code
Platform:Android
Please help!:slight_smile:
alt text

Code

var vehicleCam : GameObject;			
var vehicleCameraTarget : Transform;
var vehicle : GameObject; 
var Player;
var GetOutPosition : Transform;  					// Empty game object, where player will get out of the vehicle
var VehicleControllScript : String = "CarControl"; 	// Just write script name, which controls vehicle movement (controller script).  
private var opened : boolean = false;
private var waitTime : float = 1; 					// leave it as 1 
private var temp : boolean = false;
private var mainCamera : GameObject;



function Start () {
	Player = GameObject.FindWithTag("Player"); 		
	mainCamera = GameObject.FindWithTag("MainCamera");
	vehicleCam.camera.enabled = false;
	vehicle.GetComponent(VehicleControllScript).controlsEnabled = false;
	vehicleCam.GetComponent(AudioListener).enabled = false;  
}

function Update() {
    if ((Input.GetKeyDown("e")) && opened && !temp){
		GetOut();
        opened = false;
	    temp = false;
    }
}

function Action (){
	if (!opened && !temp){
        GetIn();
	    opened = true;
	    temp = true;
	    yield WaitForSeconds(waitTime);
	    temp = false;
    }
}


function GetIn() {
	var changeTarget : VehicleCamera = vehicleCam.transform.GetComponent("VehicleCamera");
	changeTarget.target = vehicleCameraTarget;
	Player.SetActive(false);
	Player.transform.parent = vehicle.transform;
	Player.transform.position = vehicleCameraTarget.transform.position;
	mainCamera.camera.enabled = false;
	vehicleCam.camera.enabled = true;
	vehicle.GetComponent(VehicleControllScript).controlsEnabled = true;
	vehicleCam.GetComponent(AudioListener).enabled = true;
}


function GetOut() {
	Player.transform.parent = null;
	Player.transform.position = GetOutPosition.transform.position;
	Player.SetActive(true);
	mainCamera.camera.enabled = true;
	vehicleCam.camera.enabled = false;
	vehicleCam.GetComponent(AudioListener).enabled = false;
	vehicle.GetComponent(VehicleControllScript).controlsEnabled = false;
}

Welcome to Unity Answers! In the future, please include the full text of any console errors when asking for help.

If you’re building for mobile, you should always place this at the top of your JS files:

#pragma strict

UnityScript has support for dynamic typing, but only on certain platforms. Strict mode will disable those features – they’re handy when you’re just starting out as a coder, but they’re risky because they’re not supported on all platforms.

In your case, you have a variable with no specified type:

var Player;

It looks like you expect it to be a GameObject. If that’s true, you can declare a type:

var Player : GameObject;