Avoid player blocking againt wall when is jumping

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Avoid player blocking againt wall when is jumping

Post by saturn1 »

Hello i use your method findSupport to determine if the player can jump.

But when a player jump he can block against a wall when the player press Left or Right direction.

Have you idea to fix this?

Thank you.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Avoid player blocking againt wall when is jumping

Post by Norbo »

Are you using the CharacterController, the SimpleCharacterController, or a custom implementation?

If it's just a friction issue, you can remove the friction using something like the CharacterController's RemoveFriction event handler.
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Re: Avoid player blocking againt wall when is jumping

Post by saturn1 »

Thank you it works!!
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Re: Avoid player blocking againt wall when is jumping

Post by saturn1 »

UP :P.

It works but when i remove friction after that my character slip a little.

There is a way to avoid that?

Thank you.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Avoid player blocking againt wall when is jumping

Post by Norbo »

Horizontal motion should be handled by a custom constraint (CharacterController, SphereCharacterController) or directly (SimpleCharacterController). The fact that the body has no friction with the environment should not cause it to slide along the ground unless the horizontal motion control allows it. Do you mean a different kind of slipping?
saturn1
Posts: 34
Joined: Thu Dec 24, 2009 11:14 pm

Re: Avoid player blocking againt wall when is jumping

Post by saturn1 »

Before i used LinearDamping and LinearFriction ( i guess it's a variable which decrement velocity each update) but now with RemoveFriction, if i move my character it slide a little bit on ground.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Avoid player blocking againt wall when is jumping

Post by Norbo »

It would probably be good idea just to use the CharacterController or SphereCharacterController. That way, you don't have to try and implement what they do already. The CharacterController is full featured and allows stepping, while the SphereCharacterController is a bit simpler and 'slides' over obstacles rather than stepping on top of them discontinuously.
Post Reply