Hi! Awesome engine and forums. 🙂
I have a little question about character movement. I'm trying to make a character that moves left/right across a surface while floating above it. The ways I've thought about doing this are:
1) using a sensor box to detect ground; if there is ground add some upwards force
2) cast a ray down from the player to figure out what the distance from the ground and what force to adjust by (Box2D doesn't appear to have this ability though?)
3) use a mouse joint to try to pin the player to a goal point; when moving left change the goal point
I've tired 1 and 3 so far, and they don't seem to work very well.
I'm curious if anyone has tried this or if there are other (better) methods?
Thanks! 🙂
I have a little question about character movement. I'm trying to make a character that moves left/right across a surface while floating above it. The ways I've thought about doing this are:
1) using a sensor box to detect ground; if there is ground add some upwards force
2) cast a ray down from the player to figure out what the distance from the ground and what force to adjust by (Box2D doesn't appear to have this ability though?)
3) use a mouse joint to try to pin the player to a goal point; when moving left change the goal point
I've tired 1 and 3 so far, and they don't seem to work very well.
I'm curious if anyone has tried this or if there are other (better) methods?
Thanks! 🙂