This has probably been covered a number of times already, but I can't seem to find much info relating to it through the search bar, so I'm just gonna go ahead and ask. What is the general practice for moving/floating platforms and the like?
I've been trying to create a solution just by taking a rectangle and moving it back and forth, but finding a solution that allows objects on top of the platform, such as the player dude, to move along with and not tunnel through is eluding me.
Right now I've just got the platform setting it's linear velocity every frame,
but the platform continues to fall a tiny bit each frame due to gravity and when my player dude jumps on it he'll often just slip through like it's made of jello.
Any suggestions on how to make a moving/floating platform more stable, keeping it's y position static and holding things up like it should?
I've been trying to create a solution just by taking a rectangle and moving it back and forth, but finding a solution that allows objects on top of the platform, such as the player dude, to move along with and not tunnel through is eluding me.
Right now I've just got the platform setting it's linear velocity every frame,
Code:
body.SetLinearVelocity(new b2Vec2(2, 0));
but the platform continues to fall a tiny bit each frame due to gravity and when my player dude jumps on it he'll often just slip through like it's made of jello.
Any suggestions on how to make a moving/floating platform more stable, keeping it's y position static and holding things up like it should?