Need help with a lift collider.

Hi

I have a little problem with the box collider I have added to a lift. Whenever my player moves onto it and I press the Alt button to make the lift rise, the lift goes straight through the player and leaves him stranded on the floor. The character has a character controller and the standard Third Person Controller script. The lift has a box collider and a rigidbody. Does anyone know a way that I can fix this or an easier way?

Thanks. [:)]

Well, 58 views later… :stuck_out_tongue: Looks like everyone has the same problem… :stuck_out_tongue:

Although I’m not good enough to help directly yet there were a couple of other threads with similar mechanic that may help

http://forum.unity3d.com/threads/171545-Moving-Platform-(Lift)

http://forum.unity3d.com/threads/46829-Character-Falls-Through-Elevator

Hopefully one of those may help.

Thanks for that, they where a great help :wink:

So I tried different variations of the script, and I cam out with parenting the player to the lift as he goes up, but whenever I try to click play the error “Assets/Lift_script.cs(6,25): error CS1525: Unexpected symbol :', expecting )‘, ,', ;’, [', or ='” comes up. The script runs like this;

using UnityEngine;
using System.Collections;

public class Lift_script : MonoBehaviour {
void Update() {
var main:Player;
var playerTransform = Camera.main.transform;
transform.Translate(Vector3.forward * Time.deltaTime);
transform.Translate(Vector3.up * Time.deltaTime, Space.World);
}
}

Is there anything that I’m doing wrong?

Oh, and the script is in Csharp.

-Crickets[:P]-