Releasing Character Physics Controllers

That is something we should not have to worry about doing when using the Character Controller. Fixing all the motor issues should really be up there in the Controller priorities.

Is it possible to add an option to stop the character from affecting unanchored parts when walking on them?

UpDirection has been promised for a very long time.
Is this planning to come out any time soon? Or is it worth to just custom implement this feature?
The feature seems pretty much finished by enabled FFlags.

6 Likes

Is there a reason you can’t access it from the GroundSensor ControllerSensor object under the character’s root part? There’s a property called SensedPart with a direct reference to the part that the character is standing on.

if you’re working with only parts then this works fine, but it gets a lot more complicated with terrain as you basically have to raycast it for an accurate result

1 Like

Somehow I skipped over the Terrain part of their reply. My bad.

1 Like

I’ve also got to nitpick about the fact that characters don’t move up slopes correctly by an offset, especially in diagonal directions. But also merely walking along the edges of the corner wedge causes one to stick to them rather than walk across.

Why do large characters have issues turning around? Even with the highest friction settings on the character controller, large characters will look like they are slipping when they turn around and they overshoot where they’re meant to be looking.

tbh big and small, any character seems to have this issue.

A way to adjust how fast or slow momentum decays on the character with MaintainLinearMomentum or MaintainAngularMomentum would be great. Some sort of multiplier, maybe?

Hi

Currently the character instantly snaps to the new floor height. This is OK for regular roblox characters in most cases, but it’s not good enough for more realistic cases (i.e. skinned mesh quadruped characters). The issue is most noticeable when trying to climb slopes of terrain. Instant snapping just doesn’t look good.

From what I can see there’s no simple method to smoothen the floor height alignment of the character. Will this be added in the future?

In the docs there’s a ‘StandForce’: GroundController | Documentation - Roblox Creator Hub
Unfortunately it’s not accessible yet. If this is the max vertical force to be applied for floor alignment, then my issue would be fixed.

Thanks

2 Likes

This would be handy, but also this would be quite easy to implement using your own VectorForce. Something like a drag force, for example.

I’m interested in trying to implement this now. Would it be like a force moving against the HRP’s lookVector with variable strength?

There are lots of ways of doing it. You have the right idea, but using a force against the lookVector wouldn’t work since it only considers the direction the character is facing, not moving.

Instead, the drag force should be facing in the opposite direction of the character’s velocity. Here’s some code with the basic idea:

-- hrp is the character's humanoid root part.
-- dragForce is a VectorForce affecting the hrp.
-- humanoid is the humanoid of the character.

-- Adjust DRAG_COEFFICIENT for desired amount of drag.
-- 0 means no drag, -999 means LOTS of drag!
local DRAG_COEFFICIENT = -1

local function isCharacterInAir()
	-- Assumes that the humanoid is acting with the default behaviour.
	-- This may not work if the character is using custom physics.
	return humanoid.FloorMaterial == Enum.Material.Air
end

RunService.Heartbeat:Connect(function()
	-- Apply drag only when the character is in the air.
	if isCharacterInAir() then
		-- Applying force scaled by mass for consistent acceleration regardless of mass.
		dragForce.Force = hrp.Velocity * hrp.AssemblyMass * DRAG_COEFFICIENT
	else
		dragForce.Force = Vector3.new(0, 0, 0) -- No drag when not in air.
	end
end)

This is only a rough mock-up. If you’re using an entirely custom movement system (where you set humanoid.EvaluateStateMachine to false), you might have to make your own method of checking if the character is in the air or not. This will depend on your implementation.

This code scales drag linearly with velocity (Doubling the velocity will double double the drag force, etc.). A more realistic drag force would scale with the square of velocity. Something like:

dragForce.Force = hrp.Velocity * hrp.Velocity.Magnitude * hrp.AssemblyMass * DRAG_COEFFICIENT

Both of the above examples simply apply a drag force in the opposite direction to the movement of the character. This means that it will also slow a character’s fall. If you would only like the dragForce to push the character sideways (and not up and down), you could do the following:

local function getCharacterHorizontalVelocity()
	-- Multiply the Y component of the velocity by 0 to ignore it.
	return hrp.Velocity * Vector3.new(1, 0, 1)
end

RunService.Heartbeat:Connect(function()
	if isCharacterInAir() then
		local velocity = getCharacterHorizontalVelocity()
		dragForce.Force = velocity * hrp.AssemblyMass * DRAG_COEFFICIENT
	else
		dragForce.Force = Vector3.new(0, 0, 0)
	end
end)
6 Likes

How do I use the new controller on players?? i tried importing the lua scripts and that didn’t work at all it was super buggy and I don’t understand the documentation on how to set up

I think they might be broken, I’ve followed the tutorial on the docs exactly and it just drops to the ground.

1 Like

How to Actually Use Roblox's Physics Character Controllers - #2 by 04robot48 Hello! If anyone’s having trouble setting these up, I made a topic detailing how you can go about doing so. Check it out if you’re interested

I find a bug.

When I frequently modify the EvaluateStateMachine property (True → False → True → False → True)in one or more frame(random time), there is a very small probability (one in ten thousand) that an issue occurs where the final state of EvaluateStateMachine remains as True, but the model automatically and indefinitely moves upwards (with Position.Y continuously increasing) without any external force applied.

Is there a way to do pathfinding with a controller manager? Theres no humanoid hooked up to mine, so I don’t know how it would be possible?

I love using controller managers on the previous post I read something about UpDirection being added any news on when we will have access to this?