PhysicsCharacterController drift, friction ignored

PhysicsCharacterController.calculateMovement seems to keep velocity no matter what surface friction \ controller friction is, I can not tell the difference between 0 and 10000 friction on both controller and ground.

Simplified PG based on controller doc:

I’ve found 1 factor that has not been exposed yet. I guess you wanted to increase friction to have no progressive velocity?

Initially I wanted just faster velocity dampening, so it’s not as “drifty” on surfaces.

But surface friction is important feature to have, so is controller physics body friction for different entities.

There is this gain/maxDelta that controls acceleration.

Setting the gain to 1 makes the controller to start/stop immediately. It’s in addition to friction. I’ll try to make another PG to demonstrate that. But for now, I’ll do a PR to expose these values.

1 Like
2 Likes

Tested it a little, acceleration works nicely as general purpose thing (maybe someday I’ll split it into acceleration & de-acceleration once I figure out how to git properly, that could allow more flexibility).

About friction - I did not read through physics code, but I tested on the same PG - ground friction does not affect controller:

(lowered speed, added velocity output before render and console clear on restart)

Velocity is about the same no matter how high or low friction on surface physics aggregate is set. It is slightly different between runs, but overall ~about the same values.
I hit 0.60 => 1.20 => 1.41(max) sequence on frictions 0,1 and 1000.

I think controller should consider surface it is moving on for ice physics vs solid ground (as simple example) and apply difference in calculateMovement.

Also I’m noticing both Physics Body and Physics Aggregate have only one friction.
Is it static or dynamic or both?

Sorry I missed your question :confused:
PhysicsMaterial friction (used by the aggregate) is static friction.