I am trying to make what is essentially a pet follow behind the player. I have tried AlignPosition/AlignOrientation, and it bugs out and slowly starts flipping around if the object becomes top-heavy. So now I’m simply setting NetworkOwner to the player then having the client set the CFrame of the object every frame.
Now the issue is that for some reason the object just slowly drifts out of existence serverside. It completely doesn’t respect SetNetworkOwner()
Here is an image of the problem and the code that makes the pet appear where it’s supposed to client-side while it slips into the cosmic void.
https://gyazo.com/b71ac66f24c8de4641841b343d345b5a
local player=game.Players.LocalPlayer
local RunService = game:GetService(“RunService”)
RunService.RenderStepped:Connect(function()
if player.Character then
if player.Character:FindFirstChild(“Pet”) and player.Character.Pet:FindFirstChild(“HumanoidRootPart”) then
–Instant
player.Character.Pet:SetPrimaryPartCFrame(player.Character.HumanoidRootPart.StandAttach.WorldCFrame)
end
end
end)
Is there a video to compare between normal vs top heavy using the old method? Using constraints definitely seems like a better idea than brute forcing with cframes. Even a weld will work.
As for why it is falling, it is because gravity is pulling it down, and since it never really touches anything due to collisions being off, and you are constantly moving it back up, it’s speed increases and gets offset by gravity physics more and more as time passes
Absolutely, here is what happens when you add an accessory (bearing in mind the accessory is client-side, so it is physically welded to the character and is marked as Massless)
https://gyazo.com/76b5faaabf64c194d0eb738ae3582614
Regarding the inertia being the issue, I think you’re right.
However, I’m not sure how to efficiently solve that issue. The pet is customizable and can end up with a lot of parts on it, so doing Anti-Grav with bodyforce doesn’t work.
I’ve tried Anchoring it locally after giving the client control which works client-side.
However, server-side it stops replicating the pet moving around. As a result the pet is just anchored in place indefinitely serverside, despite moving properly on the owner client.
Problem solved, made the HumanoidRootPart bigger and the bodymovers suddenly worked fine.
I think you just need to add a few zeroes to the end of the maxtorque for the alignorientation. Bodymovers are deprecated and won’t be updated anymore, better change it now than after an update that suddenly breaks your entire game