As you can see from the video, one of the models is just flying around the place, while the other 2 models actually sit next to my player. The difference between the model flying around and the ones that aren’t is it has parts welded to the main part
The model in question
Server
function CreateDuck.OnServerInvoke(Player, Tier, Rarity)
local PlayersDuck = Ducks['Tier ' .. Tier][Rarity]:Clone()
PlayersDuck.Name = Tier .. ' - ' .. Rarity
PlayersDuck.Parent = Player.Character
for i,v in pairs(PlayersDuck:GetDescendants()) do
if v:IsA('BasePart') then
v:SetNetworkOwner(Player)
end
end
return PlayersDuck
end
Client
function follow(Pet, Pos, bg, bp)
spawn(function()
RunService.RenderStepped:Connect(function()
bg.CFrame = HumanoidRootPart.CFrame
bp.Position = (HumanoidRootPart.CFrame * CFrame.new(Pos)).p - Vector3.new(0, HumanoidRootPart.Size.Y / 2, 0) + Vector3.new(0, Pet.Size.Y, 0)
wait()
end)
end)
end
function renderDuck(ducks)
local RotationOffset = 360/#ducks
for i, v in pairs(ducks) do
local PlayersDuck = CreateDuck:InvokeServer(v.Tier, v.Rarity)
local Duck = PlayersDuck.Duck
local bp = Instance.new('BodyPosition')
local bg = Instance.new('BodyGyro')
bg.D = 750
bg.MaxTorque = Vector3.new(25000, 25000, 25000)
bg.P = 5000
bp.D = 400
bp.MaxForce = Vector3.new(1250, 10000, 1250)
bp.P = 2000
bg.Parent = Duck
bp.Parent = Duck
Duck.Position = HumanoidRootPart.Position + Vector3.new(0, 0, 0)
follow(Duck, GetPointOnCircle(5, RotationOffset*i), bg, bp)
end
end