Please help with player collision script

Hello there,
I’m learning unity with “Unity Game Development Essentials”.
Now I have a task to write a script (using examples) to make myself a trigger, which opens door .

For people, who wants to help me, I made screenshots of 10 pages of the book, where the task is:

First
Second
Third
Fourth
Fifth
Sixth
Seventh
Eight
Nineth
Tenth

The actual problem with Unity
Tried a lot of variants, actually, because, I don’t know nothing in the scripting.

Unity Script Setting

My script:

private var doorIsOpen : boolean = false;
private var doorTimer : float = 0.0;
private var currentDoor : GameObject;

var doorOpenTime : float = 3.0;
var doorSlideOpen : AudioClip;
var doorSlideShut : AudioClip;

function Start ()
{
}

function Update()
{
	if(doorIsOpen)
	{
	doorTimer += Time.deltaTime;
	
	if(doorTimer > 3)
	{
		Door(doorSlideShut, false, "doorshut", currentDoor);
		doorTimer = 0.0;
		}
	}
}

function OnControllerColliderHit(hit : ControllerColliderHit)
{
				if(hit.GameObject.tag == "currentDoor"  doorIsOpen == false)
			{
			
				curentDoor = hit.GameObject;
				Door(doorSlideOpen, true, "doorOpen", currentDoor);
				Door.animation.Play(doorOpen);
	}
}

function doorOpen()
{
	audio.PlayOneShot(doorSlideOpen);
		doorIsOpen = true;
		var myOutpost : GameObject = GameObject.Find("outpost");
		myOutpost.animation.Play("doorOpen");
}

function doorShut()
{
	audio.PlayOneShot(doorSlideShut);
	doorIsOpen = false;
	var myOutpost : GameObject = GameObject.Find("outpost");
	myOutpost.animation.Play("doorShut");
}

function Door(aClip : AudioClip, openCheck : boolean, animName :
String, thisDoor : GameObject)
{
	audio.PlayOneShot(aClip);
	doorIsOpen = openCheck;
	
	Door.transform.parent.animation.Play(animName);
}

@script RequireComponent(AudioSource);

Who can, please help ;(

is this script attached to the door.

What or indeed where is the trigger object.

The door has animation of open and close slide and sounds for it. In that situation, I (first person controller) am a trigger (if i understand it right)

and script is attached to me (first person controller)

well I just went through that part of the book and by page 120 you should have this as the script:

private var doorIsOpen : boolean = false;
    private var doorTimer : float = 0.0;
    private var currentDoor : GameObject;
     
    var doorOpenTime : float = 3.0;
    var doorSlideOpen : AudioClip;
    var doorSlideShut : AudioClip;
     
    function Start ()
    {
    }
     
    function Update()
    {
        if(doorIsOpen)
        {
        doorTimer += Time.deltaTime;
       
        if(doorTimer > 3)
        {
            Door(doorSlideShut, false, "doorshut", currentDoor);
            doorTimer = 0.0;
            }
        }
    }
     
    function OnControllerColliderHit(hit : ControllerColliderHit)
    {
    	if(hit.gameObject.tag == "currentDoor"  doorIsOpen == false)
        	{
        		 currentDoor = hit.gameObject;
        		 Door(doorSlideOpen, true, "doorOpen", currentDoor);
        	}
    }
     
    function Door(aClip : AudioClip, openCheck : boolean, animName : String, thisDoor : GameObject)
    {
        audio.PlayOneShot(aClip);
        doorIsOpen = openCheck;
        thisDoor.transform.parent.animation.Play(animName);
    }
     
    @script RequireComponent(AudioSource);

Now the game starting, but still door is not opening. To make it clear - object in hierarchy - “outpost” is the parent one. Object “door” is its child

oh, now i see, it’s working now, was a problem with an animation’s names. Why it’s so case sensitive?

btw, your script is working, thanks a lot mate.