I have a platform game using Box2D and we're having some problems with trying to make "elevators" in the game.
The elevators are simply moving platforms that should be collidable and once the player stand on them, he should move with them.
The player has a dynamic body and currently we use kinematic bodies for the elevators. The elevators are controlled by
setting their velocity so that they move in a certain pattern from point A to B and reverse. We tried using static bodies for the elevators but that made the player "glide of" the elevator when it moved sideways.
Currently the problem is that the player can land on the elevators, and it works ok to some extent, but then suddenly the player gets very uncontrolled motion and can even start to spin and "bounce off" the elevator?.. (feels like he builds up energy that ends up with a big torque)
The player also start to "stutter" when he stands on the elevator for some time.
We've tried various approaches with "letting the elevator move the player" once he stand on them, and such, but it's always something that seems to fail, and it also doesn't feel very natural. The best would be if Box2D could handle the movemement without any interference.
Has anyone got a good idea of how to make an elevator type object? Classic 2D platformer feature, so there must be someone who has done it?!
Please, if you have any ideas, or have done something similar, please tell me how you did it!
The elevators are simply moving platforms that should be collidable and once the player stand on them, he should move with them.
The player has a dynamic body and currently we use kinematic bodies for the elevators. The elevators are controlled by
setting their velocity so that they move in a certain pattern from point A to B and reverse. We tried using static bodies for the elevators but that made the player "glide of" the elevator when it moved sideways.
Currently the problem is that the player can land on the elevators, and it works ok to some extent, but then suddenly the player gets very uncontrolled motion and can even start to spin and "bounce off" the elevator?.. (feels like he builds up energy that ends up with a big torque)
The player also start to "stutter" when he stands on the elevator for some time.
We've tried various approaches with "letting the elevator move the player" once he stand on them, and such, but it's always something that seems to fail, and it also doesn't feel very natural. The best would be if Box2D could handle the movemement without any interference.
Has anyone got a good idea of how to make an elevator type object? Classic 2D platformer feature, so there must be someone who has done it?!
Please, if you have any ideas, or have done something similar, please tell me how you did it!