Enter/Exit Car

I go this car script from my friend and for some reason it works just fine for him but not for me. Do you guys have any idea on how to fix it?

var Car : Transform;
var player : Transform;
var exitPoint : Transform;
var doorTriggerLeft : Transform;
var PlayerCamera : Camera;
var CarCamera : Camera;
var isPlayerVisable : boolean;

function update (){
	if (Input.GetButtonDown("Fire1")&& isPlayerVisable){
		//Make player invisable and still standing
		player.gameObject.active = false;
		// Parent player to ExitPoint
		player.parent = exitPoint.transform;
		player.transform.localPosition = Vector3(-1.5,2,0);
		//Parent playerParent to car
		exitPoint.parent = Car.transform;
		exitPoint.transform.localPosition = Vector3(-0.5,2,0);
		// Enable car as controllable object
		GameObject.Find("Car").GetComponent("DrivingScript").enabled = true;
		PlayerCamera.enabled = false;
		CarCamera.enabled = true;
		if (Input.GetButtonDown("Fire1")){
			// Make Character visable again.
			player.gameObject.active = true;
			// Unparent Player from everything.
			player.transform.parent = null;
			// Parent Exit Point to Door Trigger.
			exitPoint.parent = doorTriggerLeft.transform;
			// Disable car as a controllable
			GameObject.Find("Car").GetComponent("DrivingScript").enabled = false;
			PlayerCamera.enabled = true;
			CarCamera.enabled = false;

function OnTriggerEnter(Player : Collider) {
	isPlayerVisable = true;

function OnTriggerExit(Player : Collider) {
	isPlayerVisable = false;

Also the I get no error messages from the code when I use it but for some reason I can’t get it to actually work.
I am also using the Unity Car Tutorial.

It’s function update. It needs to be
function Update() {.

no errors… kinda hard to know what you are saying isn’t working. make sure all the variables are assigned; there needs to be a collider attached to the gameobject; The car object needs to be named ‘Car’ because its looking for that… comment things out and work through things.

i wrote this script itz totally functional…

I noticed in the code you put
function update()

The function Update is supposed to be like this below
function Update()
Update needs to be a capital letter

I think I can help you, the button to enter in the car isn’t the “e” key, it’s the right button on the mouse. Click with this rigt button on the car and it works !
Sorry for my bad english, I’m french…

hay all been working on a script for a few months now its finished sadly its not free but if you are not able to get ur own one to work i thought it might help you get back on track :slight_smile: