Physics while moving up and down

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
nikolaiko
Posts: 43
Joined: Mon Aug 04, 2014 8:26 am

Physics while moving up and down

Post by nikolaiko » Mon Apr 13, 2015 12:37 pm

Hi, I have question about moving up and down on the hill. Is there any ways to make move slower then moveing up the hill and faster then going down?

Thanks.

Norbo
Site Admin
Posts: 4615
Joined: Tue Jul 04, 2006 4:45 am

Re: Physics while moving up and down

Post by Norbo » Mon Apr 13, 2015 5:15 pm

One option would be to use the CharacterController.SupportFinder.SupportData.Normal. The normal points away from the character at the point of contact, so you can take the desired horizontal movement direction of the character in world space and dot it against the normal. A value of near zero is walking on a horizontal plane. If the value is closer to 1, that means the character is walking uphill. If the value is closer to -1, the character is walking downhill. That value can be used to change the CharacterController.SpeedScale (or other specific speed properties).

You could also adjust forces with that value. Or, if the character's movement forces are set low enough, gravity will slow down/speed up the acceleration by itself.

nikolaiko
Posts: 43
Joined: Mon Aug 04, 2014 8:26 am

Re: Physics while moving up and down

Post by nikolaiko » Wed Apr 15, 2015 6:30 am

Thanks!

I will check second option and if gravity doesn't slow movement I will try first option.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests