This topic is 2596 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Im implementing a character controller for my physics engine. It worked well on a flat platform. Now I wonder how to avoid the sliding on a slope when the character is standing still? I tried to modify the friction value when itsnot moving, but it takes a while before it comes to a full stop. Help?

##### Share on other sites

Im implementing a character controller for my physics engine. It worked well on a flat platform. Now I wonder how to avoid the sliding on a slope when the character is standing still? I tried to modify the friction value when itsnot moving, but it takes a while before it comes to a full stop. Help?

If you use the character constraint I described in your other thread, this just happens automatically

Cheers, Paul.

##### Share on other sites
Ok, but I think that'll make my character 'sticky'. What if another object bumps into it? it should get some impact, right?
TBH I dont fully understand the inner working of your character controller(hehe). It modifies speed to match desired target velocity right?

##### Share on other sites

Ok, but I think that'll make my character 'sticky'. What if another object bumps into it? it should get some impact, right?
TBH I dont fully understand the inner working of your character controller(hehe). It modifies speed to match desired target velocity right?

Thats what the strength parameter is for - you don't want it to be infinitely strong.

Cheers, Paul.

##### Share on other sites
Umm you got any good reference to read? I think Im a little bit confused =.=a

##### Share on other sites

Umm you got any good reference to read? I think Im a little bit confused =.=a

Sorry, no reference I know of - you'd have to design the constraint from the ground up, but its not that hard to do

##### Share on other sites
Ok. I think I'll have to figure it out later, I'm coding the primitive vs static mesh at the moment...will be back later...

##### Share on other sites
Post the exact codes.

##### Share on other sites
Well here's what I do
 void ChangeVel(vec3 targetvel) { m_vVel+=(targetvel-m_vVel)*m_fRate; } //where does the strength value come into play?? 
I think I got it I'll test it later...

##### Share on other sites

Well here's what I do
 void ChangeVel(vec3 targetvel) { m_vVel+=(targetvel-m_vVel)*m_fRate; } //where does the strength value come into play?? 
I think I got it I'll test it later...

No, I'm afraid that's not going to do it

Firstly, you can't just arbitrarily start modifying velocity like that - you need to compute an impulse which involves two bodies; the character and the thing he's standing on. Remember Newton - equal and opposite reaction

Cheers, Paul.

• 22
• 10
• 19
• 15
• 14