- Home /
Why does player fall through elevator animation?
Hi people,
really new to unity and scripting here.
Basically I created a triggered animation, which I'd hoped would act like an elevator for the First Person Controller.
The elevator lifts through the player.
I've tried putting different colliders on the player. I've tried adding rigid body to the player.
Any feedback or advice would be greatly appreciated.
Chris.
Answer by cristo · Sep 09, 2014 at 12:05 PM
Thanks so much for the response.
I tried parenting a small cube with the mesh renderer switched off that was checked as a trigger, but when I did, the lift animation wasn't triggered.
So I had a block called 'lift' and another block which was a trigger. In the Js code I had: GameObject.Find("Lift").animation.Play("LiftUp"); I wasn't sure whether that meant I needed to tag the lift block or trigger block with a tag called 'Lift'. I've tried so many combinations. I'd rather the code be in C#. I'm a real newb, and I'm just trying to get results in the 6-8 hours I have to work it out. But I will definitely keep trying when I have free time again. :)
Answer by ThePersister · Sep 09, 2014 at 10:00 AM
It's hard to guess the details of your collision from only the scene views, so maybe more details would help.
One thing you should know is that marking a Collider as "Trigger" will have it ignore collisions with the world environment. So I take it your elevator is a "Trigger" and probably won't collide with anything.
If that's the case, I'd suggest ticking off the "Trigger" checkbox on the Elevator collider and adding another collider on top of the Elevator that activates the activation when you enter that one instead :)
Give that a shot, if you need more explanation, more details or if you have further questions or details for us, fire away, otherwise, please accept this answer ;)
Answer by Lasconik · Sep 09, 2014 at 10:57 AM
The player needs: - a collider (not too small), not trigger - a rigidbody
For the elevator, you can have two different colliders : 1 trigger and 1 not triggered. As ThePersister said, triggered ignore physics collisions. An other way is to create an other gameObject with a trigger, at the same location than the elevator. The advantage is that when you go back to the elevator, it won't move up again and again.
Answer by Levr01 · Dec 17, 2019 at 08:01 AM
Unity animation do not use physics calculations the just move the object
Your answer
Follow this Question
Related Questions
Player Falling Though Floor After Build With Unity IPhone 0 Answers
Problem Player walks through stairs / How can I make the player not walk through things 0 Answers
Player(box) randomly falls through objects. 1 Answer
Falling through the floor issue 11 Answers
How to make a GameObject that collides but the player can go through it? 2 Answers