I’m trying to build a fairly complex elevator script (10 elevators and 7 floors)
I’m trying to make the player parent to an elevator platform (elevator name is portOneEle) when the player triggers/collides with the collider called portOneEleArea (which is a box collider on top of the platform).
This is what I have, which, intuitively seems like I’m on the right track but… what the hell do i know?!
var Player:Transform;
function OnCollisionEnter(collision : Collision) {
Player.parent=portOneEle;
}
function OnCollisionExit(collision : Collision) {
Player.parent=null;
}
problem is… the script doesn’t know what the object portOneEle is, and I’m not sure how to pass that into the script.