#CharacterBody2D slides too much with friction set to 1

1 messages · Page 1 of 1 (latest)

tired stream
#

How can I make character slide less? Because for now its like on ice and not good for controls

tulip jetty
#

I think you need friction on both sides for it to do anything

tired stream
tulip jetty
#

With move_and_slide the built-in friction doesn't do anything, because you're setting the velocity yourself

#

So it's up to you to use a lower velocity when you want the character to move slower

tired stream
#

So I guess the best choice would be to lerp velocity to 0 after key was depressed

tulip jetty
#

Right, that would be the equivalent of adding linear_damp to a RigidBody, like air resistance

#

I think it's more common with CharacterBody to just set the velocity to zero each frame, and rebuild it from scratch

#

For movement that's based on momentum, eventually you might want to consider limiting a RigidBody instead of building up a CharacterBody

#

Basically one starts with everything, and the other starts with nothing

#

And then you customize it to either add or take away behaviors

tired stream
#

I was actually thinking because RigidBody seems more useful due to just being easier

tulip jetty
#

Right, and the downside is that by default it will do a bunch of things you don't need or want