I’ve been noticing that characters in my game seem to have trouble walking up stairs when using the PGS solver. I put together a simple repro unit test for the problem and can confirm there are inconsistencies in how the Humanoid reacts to stairs when using PGS.
When using PGS, the Humanoid likes to rapidly alternate between the Running/Climbing state. It seems like it isn’t realigning with the floor very smoothly, and so it gets confused and tries to start climbing.
The unit test I provided seems to be a little flaky. Not sure if measuring state changes is the best way to determine if its working correctly, rather, it should fall down to the amount of time it takes for the Humanoid to climb the stairs.
I think I have a fix for PGS that involves tuning humanoid power in terms of climbing and maintaining altitude. I’m going to experiment with some places on Monday and hopefully put it on globally. I’ll PM you details so that you can verify in your tests as well.
From my testing the fix addresses both issues. I’m concerned about globally changing settings for character behaviors for EVERY user on the platform so I want to do some diligent testing before I make the change.
I did find one issue, but I’m not sure if this is the fault of how I’m handling this mechanic in my game or if it’s something that you might be able to address.
I have a script in my game that emulates how Roblox characters used to bounce when jumping from high distances back in the day. This is the code I wrote to do it:
local Debris = game:GetService("Debris")
local char = script.Parent
local humanoid = char:WaitForChild("Humanoid")
local head = char:WaitForChild("Head")
local function onStateChanged(old, new)
if new.Name == "Landed" then
local velocity = humanoid.Torso.Velocity
local power = (-velocity.Y * workspace.Gravity)/2
local force = Instance.new("BodyForce")
force.Name = "Bounce"
force.Force = Vector3.new(0, power, 0)
force.Parent = head
Debris:AddItem(force, 1/30)
end
end
humanoid.StateChanged:connect(onStateChanged)
This is supposed to make the Humanoid bounce a few studs upwards when they jump from a platform with a height of like 50 studs. I had to tune the forces to get the Humanoid to properly react though, as there seemed to be something counteracting it.
With the change enabled, the Humanoid becomes a LOT more bouncy, but only like half the time. It’s inconsistent and I’m not sure what’s going on. There seems to be some sort of race condition.
Thanks for taking the time to test it. I’m going to take a look at this in an hour to see if I can find fault in what your script does or if its something on our end.
From my observation it seems more like a fault in my script, because it appears to rely on some arbitrary resistance force being applied to the Humanoid when it lands. If I need to tune it to work within the new configuration then by all means I’m fine with doing so.
So, it may not be your fault entirely. I tested the new controller values in Natural Disaster Survival. They worked great in 99% cases, but as soon as balloons and long drop heights were involved bad things started happening.
Essentially the way the controller works right now is that it is allowed to apply forces on the character to make sure the legs are pulled out of the ground until hip-height is achieved. However, if the forces it accumulated are strong enough to send the character flying we do not allow counter-forces to prevent this launching behavior. I think this is what you are seeing.
I’m investigating a better way to handle this, but it will require a code ship to release rather than tuning existing values.