make an elevator

Hi
I want to make this cylinder as an elevator. when i press a key like ( h ). the elevator move up and should take my character with it. but my character still down. how to make a script to make my character move up with the elevator.

this is a short sceipt to make the elevator move up when i press a key such us ( h ) in ths case.

function Update ()
{
if(Input.GetKeyDown(“h”))
animation.Play(“Obs 1”);
}

Obs 1 is the name of the animation attatched to the elevator.

how can i do the rest…[/url]

There is one in the 3D platformer (lerpz one)

I Know, i’m new in unity 3d so i try to beter know it.

If you type in search you will find that elevators and platforms are very popular. I’m sure there are a few examples here in the forum. :smile:

Most i’ve seen deal with the character being a temp child of the platform while inside a trigger just above the platform. With the right collliders
and a little transform y or vector 3 up to keep the character up and not falling through. :idea: