- Home /
What is the best method for moving platforms?
Hi i would like to know is it bad to move a Rigidbody(player) with an animated platform( elevator)? Say i have an elevator i feel that it is much easier to animated the movement of the elevator than doing it with bezier curves and coding the movement. What is the best practise for this when having a RB player? Should i just put the animated elevator as a iSkinematic or must i go with all physics RB elevator addForce/.velocity and all that headache stuff?
Animating like this is fine, just switch the animator to physics simulation.
Life feels so good when there are simple anwsers and solutions to problems.
Answer by frankslater · Sep 22, 2017 at 01:59 PM
Yes, the best practice is as you suspected. You definitely want to make your elevator kinematic since you are not intending to move it by physics.
You would use physics, if for example your elevator line broke and your elevator fell (i.e. if any physics force affected it). I have changed isKinematic by code when something got dropped like that (runtime during gameplay). Example: You have a medieval rope elevator affected only by its mechanism. You use animation for its normal functioning (kinematic rigidbody) then someone shoots the rope and the elevator falls. That's the point where you turn off kinematic. See isKinematic documentation for reference and example code.
TL;DR
You would like the elevator to interact with the player, so you add your colliders.
Since it moves, you best add that Rigidbody as well.
Its position is only affected by it's mechanism, so you animate it and make the Rigidbody kinematic.
Your answer
Follow this Question
Related Questions
simple collision not working 1 Answer
Moving an object in 3D Space ~ Complexity 1 Answer
When Player rotates movement seems reversed. 1 Answer
Addforce up to kenemetic rigidbody of the triggerobject player 2 Answers
Flying collision 0 Answers