- Home /
Player Falling Through Elevator
In my scene I have an elevator where the player can walk on and it will move up. I created an animation for it and used this script to activate it.
function OnTriggerEnter (other : Collider) {
animation.Play();
}
The problem is whenever the player walks on the elevator and it starts moving the player falls right through the floor. I think it might be something to do with the player. Thanks for any help.
Answer by RampantStudios · Mar 06, 2011 at 12:12 PM
You will want to put a game object just under the elevator floor with a box collider, make sure that box collider is set to NOT be a Trigger.
The problem your having is that you've set the elevator to be a trigger but as a trigger doesnt actively collide with other objects (It just sends events when things go through it) your character is falling through it.
Give me a shout if that works, if not drop me a message here.
I do have a box collider on my elevator. I used an empty Game Object to use it. When I walk on the elevator my character stays on it, but only when it starts moving does it fall through.
Oh in that case, make sure you move the character thats standing on it up before you move the elevator up (Otherwise the character will clip through the collision mesh and fall through).
Answer by Myth · Mar 05, 2011 at 10:14 PM
Have you got the charactermotor or other such script attached to the player object?
(not sure on wiether this will work with animation but does work with scripted movements.)
Okay, so I found the script, but when I tried to add it Unity said the script class couldn't be abstract. I'm using the First Person Controller standard asset if that helps.
Answer by Velketor · Mar 16, 2011 at 03:02 PM
just duplicate your elevator and turn off the mesh renderer. it will provide 2 checks for the mesh collision instead of just 1. this has fixed problems for me in the past with animations and falling through during movement.
Answer by Ricky Stefani · Mar 18, 2011 at 06:02 PM
Do you know OnTriggerEnter need the is Trigger(True) right?
I don't think you're referring to my problem. The animation plays just fine, it's just my character falls through the floor when the elevator moves up.
Answer by bwiegele · May 20, 2011 at 01:19 AM
logging_out, did you get a solution to this as I'm having the same problem. I'm using a 3rd person controller and I do have the Normal Character Motor script on him as well.
But each time I step on the platform it raises but only takes my character about half way up before he just falls through it.
I've tried doubling the mesh as well. Nothing.
No I still haven't figured it out, I even tried changing the script to work differently. I'll post an answer though if I do find out.
Your answer
Follow this Question
Related Questions
problem with character 1 Answer
Character falling through terrain 1 Answer
Why is my player falling through the terrain? 1 Answer
Making items solid? 3 Answers
Platform Effector 2D with rigidbody2D 0 Answers