- Home /
How to get a character to stay on a moving platform?
I've been trying to implement a way for my character to stand on moving platforms, but no matter what solutions I've tried that I've found (parenting, setting the velocity equal to that of the platform's, using MovePosition, or even using the code from the Acrocatic package on the asset store) my character either slides, bounces, or falls straight through the platform.
I'm using the CharacterController2D from here: https://github.com/prime31/CharacterController2D/blob/master/Assets/CharacterController2D/Scripts/CharacterController2D.cs
Along with the PhysicsPlayerTester from the same place: https://github.com/prime31/CharacterController2D/blob/master/Assets/CharacterController2D/Demo/Physics-Based/PhysicsPlayerTester.cs
Any ideas on something I could attempt?
Answer by master_moridin · Oct 10, 2014 at 07:12 AM
I wound up finding and using the method described in this video: https://www.youtube.com/watch?v=hkLAdo9ODDs&list=UUCc85sCjXZish1mGnm8vRFg
Based on a cursory glance it seems to be really similar in basis to the one you linked, and this one definitely works.
Answer by jester-race · Oct 06, 2014 at 06:11 AM
I'm not sure if this would work, but have you tried giving the platform a physics material with high friction?
I did try that, it didn't help any. Character continued to slide on top of the platform.
I just found this tutorial last night. The only part I've watched so far is the one about horizontally-moving platforms: https://www.youtube.com/watch?v=iUSzqX3dqrg#t=398
I'm actually amazed by how simple it is. Let us know if you get it working, especially if you use the method described in that video.