Character velocity not replicating with CharacterAutoLoads set to false

I noticed this last night when working on animations, figured it was my code and went to bed thinking it was some bug I introduced. Turns out it’s not something I did after all. Velocity replicated before the last update, not sure exactly what changed to cause this bug.

It seems that with CharacterAutoLoads set to false, player:LoadCharacter() isn’t properly setting physics ownership (I can only guess) and it’s causing the Velocity property on the parts of the characters to not replicate.

Repro steps:

  • Turn CharacterAutoLoads under the Players service to false
  • Make script to call :LoadCharacter on players who join and on characters who die
  • Client side print of the Velocity of each player character’s HumanoidRootPart
  • Starter server with 2 or more clients, observe output with frozen velocity values

I’ve attached a repro place that’s already set up with the steps steps listed above, just skip to step 4. As far as I can tell FE doesn’t effect this, nor does Humanoid RigType. CharacterAutoLoads is the only property that I’ve found that effects this. With CharacterAutoLoads to true velocity seems to replicate fine (regardless of FE).

velocity replication repro place.rbxl (11.0 KB)

2 Likes

I’m having the exact same problem, noticed it today while working on my procedural animations.

Here’s an example of what happens when I try to print another client’s character’s velocity with a localscript and FE enabled:

The code I’m running:

[code]local function characterAdded(character)
if character.Name ~= game.Players.LocalPlayer.Name then
local hrp = character:WaitForChild(“HumanoidRootPart”)
while wait() do
print(hrp.Velocity.magnitude)
end
end
end

local function playerAdded(player)
repeat wait() until player.Character ~= nil
characterAdded(player.Character)
wait(1)
player.CharacterAdded:connect(characterAdded)
end

for _,player in pairs(game.Players:GetChildren()) do
playerAdded(player)
end

game.Players.PlayerAdded:connect(playerAdded)
[/code]

Can we get someone to look into this please? It’s kind of a big problem for anything that relies on velocity.

1 Like

Found the bug, see my comment in:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.