How to gradually slow down body?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

How to gradually slow down body?

Postby haxx » Thu May 02, 2019 1:25 pm

Hello,

I am trying to implement a character walking around a heightmap. I got the heightmap loaded, and my character is a sphere collider. Collisions work as expected and all. To move, I apply a force in the movement direction using AddForce, and a gravity force pointing downwards is applied every time as well with AddForce.

My problem is, the character is barely controllable, because it's moving like on ice. Once it starts going down the slope, it never stops.

I tried setting damping using NewtonBodySetLinearDamping, even to crazy values like 99999.0 but it doesn't seem to have any effect.

My expectation is that the character easily speeds up on 45* and steeper slopes, but if the slope is something like 5* it doesn't slide automatically at all. Any pointers on how to implement that using Newton?
haxx
 
Posts: 1
Joined: Mon Apr 22, 2019 12:48 pm

Re: How to gradually slow down body?

Postby Julio Jerez » Thu May 02, 2019 3:23 pm

Are you try to make a capsule player controller or are you trying to move a rolling ball on a terrain?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: How to gradually slow down body?

Postby JernejL » Sun May 05, 2019 4:42 am

You mentioned walking, so in my answer, i will assume that you mean a walking character, and not a sphere.
I think what you need is a upvector, to hold the sphere / ellipse upwards, so it would not roll, this would still give you ground friction to overcome if you want quick direction-changing turns, but that has to be handled by the character controller itself, i guess you start with the upvector joint and see how that changes it.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: How to gradually slow down body?

Postby Julio Jerez » Sun May 05, 2019 10:22 am

for what ever is worth, I re enabled the basic player controller.
I far simpler to undertand now, I think or I hope.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: How to gradually slow down body?

Postby Kraatz » Wed Jun 05, 2019 9:16 am

JernejL wrote:You mentioned walking, so in my answer, i will assume that you mean a walking character, and not a sphere.
I want to try these fat burners for men and think what you need is a upvector, to hold the sphere / ellipse upwards, so it would not roll, this would still give you ground friction to overcome if you want quick direction-changing turns, but that has to be handled by the character controller itself, i guess you start with the upvector joint and see how that changes it.


Does the basic player controller make this much easier? Are there any tutorial son this by any chance?
Kraatz
 
Posts: 1
Joined: Tue Jun 04, 2019 5:09 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 14 guests