Humanoid is infinitely spinning and floating by an unknown force after applying mover constraint

In my game, the playing field is always at the same height. For that reason, we have a mechanic for if you manage to fall on top of a prop with increased height, you’ll get pushed off. The push velocity is applied using a linear velocity. This linear velocity is always parented but is only enabled when it has a force with a magnitude greater than 0. However, walking in the opposite direction of the force while it is active causes the humanoid to start floating and spinning even after the force has stopped.


In the video, you’re able to see the force infinitely being applied even when trying to change it. There are no other forces applied using code.
I wasn’t able to reproduce the bug on an empty baseplate. However, this devforum post seems to describe a similar issue.
This user also describes and has a video of the same issue.
Here aswell.

Notes

  • The teleporting in the video is click teleport.
  • The humanoid does fall down when platformstand is enabled.
  • This also happens when manually setting the velocity of the HumanoidRootPart.
  • When launching the humanoid upwards with a Y velocity, it is not able to move in the air and keeps the velocity it had pre-launch.

System information

  • AMD Ryzen 7 5700G with Radeon Graphics
  • 16GB DDR4
  • NVIDIA GeForce RTX 3060 Ti

I figured out the cause and it was the Freefalling humanoid state being disabled. Is this intended behavior? Because it seems inconsistent.

3 Likes

@daimywil Is it possible for you to give us a repro place for this. Also it looks like you might have gravity disabled? If that’s the case then this behavior does make sense, the body is maintaining it’s current velocity as applied by the constraint.

1 Like

Hey! Gravity was not disabled. I made a repro place but I could only get it to happen once. Seems to be pretty inconsistent. It sent me flying and rotating like in the video when walking over the part. Sorry that I can’t provide much more :frowning:.
repro place.rbxl (55.5 KB)

1 Like

@Daimywil Is it possible to add the code you were using to teleport to the repro place? It might make it easier to reproduce the bug there. Thanks!

1 Like

Here is the code for the teleport during production testing:

local teleportOptions = Instance.new("TeleportOptions")
teleportOptions.ReservedServerAccessCode = accessCode
TeleportService:TeleportAsync(placeId, ingamePlayers, teleportOptions)

Although the bug has happened during studio testing aswell.

Is that the literal server teleporting or the character teleport snippet

Ooh yeah you’re right. I misunderstood the question. Here is the code snippet for the click teleport as shown in the video:

local plr = game:GetService("Players").LocalPlayer

local char = plr.Character
if not char then
    return
end

local root = char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Torso")
if not root then
    return
end

local cam: Camera = workspace.CurrentCamera
local mouse: Mouse = plr:GetMouse()
local params: RaycastParams = RaycastParams.new()
params.FilterDescendantsInstances = { char }
local rayResult: RaycastResult = workspace:Raycast(cam.CFrame.Position, mouse.UnitRay.Direction * 5000, params)
if rayResult then
    local tpPos = rayResult.Position + Vector3.new(0,3)
    root.CFrame = CFrame.lookAt(tpPos, tpPos + root.CFrame.LookVector)
end