Airspeed and Rotation

Topics: User Forum
Feb 25, 2010 at 9:40 AM

Hiya,

Okay, i'm writing a side-scrolling, platformer game. I have two questions:

1) The rotation mid-jump thing is VERY cool, however, not what i'm looking for, however, I do like the the fact the character can "fall" of the edge of an object, if it lands past its center of gravity. How can I limit this rotation mid jump, but still let the person "rotate and fall" of the side of a platform. FixedAngleLimitJoint didn't work, as it cause the character to be able to balance on its point, on the maximum rotation, but not fall.

2) Any way I can limit horizontal airspeed?

Cheers,
BageDevimo

Feb 28, 2010 at 10:04 PM

/bump

Anything, guys?

Mar 2, 2010 at 9:12 AM

I'm not sure to understand your first question... Can't you check your character's rotation at each update?

For 2), you can check at each timestep your character's horizontal speed and apply impulses according to the speed you want to limit to.

Mar 2, 2010 at 10:31 AM

your idea for the 2nd q will work, first q is this: i want the character to fall of the edge of platforms, but not to rotate in midair.

 

Thanks!

Mar 4, 2010 at 7:18 PM

It sounds like what you want to do is detect when the player IS jumping and then create a fixed angle joint so he does not rotate. Then when he lands or collides with something remove it so he can rotate.