Help|Get into car

hey everybody.
I have a car and player with script (The player have script for moving and everything)(The car have script of waypoints and rigidbody).
how can i make that if the distance of the car and me (The player) is 5 meter or something else like that,
so the player get into the car.
and i can to drive with the car.
(I have car moving script that i made).
TNX a lot for the helping! :).

http://forum.unity3d.com/threads/62425-Unity-3D-Get-Into-Car

but dude,
now i change things…

EDIT:
I do now what they told me to do but:
when the car and the car was together (I mean the player is in the car) the vehicle goes crazy and moves frantically!
it’s realy strange,
Why it’s happening???
How can i fix it???
(the car and the player have collider the car have collider for himeself and the player have collider for himself).

Try disabling the collider for the player.

but then he can move in object like building…
and how i active the car driving script when i get in into the car?
and how i disactive the moving script of the player?

http://forum.unity3d.com/threads/34015-Newbie-guide-to-Unity-Javascript-(long)

okay dude TNX.
i have now this:

but it’s giving to me a error:

boolean, not bool

now it’s have tree same errors:

player.collider.isTrigger

dude,
it’s still moving crazy (The player) when he is in the car :(…
EDIT!!!
YES!!!
it’s working i doesn’t belive it you are the best man that i ever see!!!
but just one more thing.
how can i make that when i get in the car the driving script will enabled?
and the moving player script will disenabled?

can you give me example?
TNX.

i have this:

but it’s doesn’t working…

I would have assumed that the player’s collider isTrigger property would be disabled when entering the car, then enabled again when outside the car.

EDIT: also, it looks like the player’s position isn’t snapped with the car after entering; it only snaps the position so long as the user holds down “F” (but perhaps that is your intent)

so what i need to do to make it snap “always”?

Unless you want the car to drive off without your player, then yeah. You can achieve this by temporarily making the player a child of the car, or by always setting the player’s position equal to that of the car’s during the Update().

and what is it “player a child”???

okay finaly i usy Destroy Objects.
i have that:

}

i doesn’t know why but the “carwaypoint” doesn’t destroy!
what is the problem???