Hi I’ve build an elevator in unity for the fps controller to get to the next floor. It is pretty simple it is an animated platform which is triggered after a player collision. The script works fine, once there is a collision the animation starts. The problem is the controller falls through the platform… is there something I should know about animated geometry and colliders? I haven’t got a clue why this happens.
you should move your elevator with forces, not with an animation. if you check your animation, the object will trespass the controller, but the collider will stay where the platform stayed.
You can move the elevator with animation (in fact, putting forces on it without using a physics-based character controller won’t work either), but because the character controller just falls if there’s nothing beneath it and doesn’t respond to movement below it, it falls through the bottom when the elevator goes up. There’s a detailed description of the problem in the 2D Platformer Tutorial, but I can’t get the PDF to open. If you look in the project, though, there is a script to make the moving platform work with a 2DPlatformer Controller that you can modify to work with your controller.
I’m still looking for a solution to this problem.
There’s a new thread here, but so far I haven’t been able to keep my CharacterController from falling thru a moving platform (either animated or moved in code).
Hi !
I used to struggle with this one also.
Can´t remember the code, but the most brilliant thing
is that one doesn´t have to use (
somewhat annoying and quirky physics = valuable
prosessing time for this:
Ingredients:
When player enters the collider (plane for e.g, switch)
(at the entrance of the elevator) it becomes the CHILD of the elevator.
When player exits the elevator through another
collider, it´s detached from the elevator.
Hope this helps.
Cheers !!!