Hi,
I've got a random created landscape which is made up of box2d bodies, now, when my player (box2d object) goes over this landscape, I want it to follow it, i.e. not go off the ground, how would this be done - would I need some type of joint?
Regards,
Steve
I'm not really sure what you're asking there Steve - do you mean, that you're getting a problem where your player object goes into the air as it tries to move over terrain? Or when it goes down terrain it 'floats.' If that's the case then that's a byproduct of the engine - a fix would be to make your player object very dense, which would give gravity a greater effect on it and hence it would drop faster.
The big problem that you'll have with making a joint to the ground is that if you have your landscape made up of lots of different objects then you'd need to create and destroy that joint as you pass over a new object, not impossible but could be costly on efficiency.
SC.
Hi,
The object moves correctly when going over the terrain, was just wondering if it was possible to 'fix/glue' the object to the landscape (like in line surfer, but I doubt that uses box2d) or even when object does go in the air, stop it from going too high.
Thanks,
Steve