How to Actually Use Roblox's Physics Character Controllers

Thanks for this! Seems to work well.

I believe there is a bug in the Jump action though, specifically regarding the opposite force applied to the floor. There you set the ground sensor’s hit normal as the position, which seems erratic. My suggestion is to change it to the ground sensor’s hit frame position instead, like so:

floor:ApplyImpulseAtPosition(-jumpImpulse, controllerManager.GroundSensor.HitFrame.Position)

Hope this helps and thanks again!

1 Like

why does controllerManager.MovingDirection = Vector3.new(0, 0, 1) work but not

local movingDirection = controllerManager.MovingDirection
movingDirection = Vector3.new(0, 0, 1)
???

Thats cause you’re changing the variable “movingDirection” and not the property “MovingDirection” of the controller

But that = that all I did was made it shorter

the variable only gets the value of the property, so it can’t change the property’s value directly, you’d have to write it like this, which would make it longer than just leaving it how it was.

local movingDirection = controllerManager.MovingDirection
movingDirection = Vector3.new(0, 0, 1)
controllerManager.MovingDirection = movingDirection

well you can not shorten that.