- Home /
Prevent Player to fall of a rigidbody platform
Hi, I got a platform that is controllable by a player, while an other player can walk around on it. The players are currently moved with simpleMove and got no rigidbody attached, because they shouldn't be affected by physics. It is important that the platform can collide with other colliders, so I attached a rigidbody to it. When no rigidbody is attached and the platform is moved by its transform, everything works fine. But when I attach a rigidbody and apply forces, the player who walks on the platform slides of it and falls of the plattform. Does somebody know a solution for this, so the player can walk on the rigidbody platform like he can on a not moving ground?
Answer by create3dgames · Aug 31, 2012 at 07:16 PM
Yes, I know the solution. You need to parent the player to the platform at runtime, through scripting. Meaning, as soon as the player is on the platform, make the platforma child of the player. When the platform reaches its destination, unparent the platform. Then you can step off the platform. I believe that will solve your problem.
Hi, that only works if I move the platform by its transform, not if I apply forces. I need a solution that works on a rigidbody platform
Answer by Merlok_3_0 · Jan 26 at 09:06 PM
Why not to just teleport player to the difference + platfrom pos and just change difference when player moves?
Your answer
Follow this Question
Related Questions
Character Controller and Moving Rigid Bidy 0 Answers
What is the best method for moving platforms? 1 Answer
C# player rigidbody, permaTransfer and moving platform 0 Answers
Making an object collide with an object without altering its physics? (moving platform) 1 Answer
Moving kinematic rigidbody causing strange physics behaviour, is this a bug? 0 Answers