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?
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);
}
}