I’m using an align position inside of a pet to make it follow the player, but whenever I teleport the pet stops moving. I tried setting MaxForce to inf and Rigidity Enabled to true but the pet still doesn’t move after I teleport. The pet only starts moving again when I get close to it but I want it to be able to follow me even when I teleport.
The pet and alignposition are created in a localscript.
The Teleport is in a Server Script like this:
--this is only for testing
script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
part.Parent:PivotTo(CFrame.new(-959.5, 6.676, -144))
end
end)
1 Like
Sounds like you’re teleporting the pet out of the character’s NetworkOwnership region, causing it to be automatically reassigned to the server. Here’s an article explaining Network Ownership. On the server, manually set the Network Owner of the pet to the client that owns it using the SetNetworkOwner method.
You can use these 2 debug visualization settings in studio to see the network owner as well as the region of automatic assignment around the character.
But the pet is created in a localscript? Shouldn’t it always be in the clients network ownership since it only shows up on the client.
Bumping this post because I am having the exact same issue.
The solution I’m thinking of using is setting all the pet’s positions to the player whenever I teleport the player, but that seems quite annoying to do.
Something like;
for _,Pet in pairs(Folder:GetChildren()) do
Pet:PivotTo(Character:GetPivot())
end
If you did end up finding a solution to this please let me know.