AlignPosition Delay

AlignPosition seems to delay on client.

Server: (Responsive as possible)
https://i.gyazo.com/700499ebe023c20b4d99546b63033b4f.mp4

Client: (Delays)
https://i.gyazo.com/ca5c86824d55efb18e039517dc1f2775.mp4

Properties:
image

Perhaps setting the NetworkOwner to the player who the NPC is getting attached to will reverse this effect; be instant on the client and delayed on the server.

This is usually due to the rig and the player having different network owners. Try using BasePart:SetNetworkOwnership(YourPlayer) on every single part in the rig. This will help you remove the lag.

The server is handling the physics of this NPC, so naturally the delay to see that includes the client’s ping. To fix this, set the Network Owner of the NPC to the player who is controlling them. This is the code for @awry_y’s response, so please mark their post as the solution if my code works.

local function setOwner(model, player: Player?)
    for _, obj in pairs(model:GetDescendants()) do
        if obj:IsA("BasePart") then
            obj:SetNetworkOwner(player)
        end
    end
end

-- later:
setOwner(player.Character.NPC, player)

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