In my game players cannot collide with each other. The pets are also non-collide and reside inside the player character. They use a bodygyro and a bodyposition to follow the player's right lower leg. Here is the script that is inside each pet:
local Character = script.Parent.Parent local Orb = script.Parent:WaitForChild("headPart") local BodyPosition = Orb:WaitForChild("BodyPosition") local BodyGyro = Orb:WaitForChild("BodyGyro") BodyGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) BodyPosition.MaxForce = Vector3.new(math.huge ,math.huge, math.huge) while wait(0) do BodyPosition.Position = Character.Head.CFrame:pointToWorldSpace(Vector3.new(3, -3.5, 2)) local X = Character.Head.CFrame.x local Z = Character.Head.CFrame.z BodyGyro.CFrame = CFrame.new(Orb.Position,Character:FindFirstChild("RightLowerLeg").Position) BodyGyro.CFrame = BodyGyro.CFrame * CFrame.Angles(0,5.5,0) end
I've dragged the pet all around the map without issue, it doesn't get stuck on anything and nothing unexpected happens... until you get close to another player. Here is a gif that shows what happens: GIF Basically, when the pet gets close to another player character it occasionally goes flying across the map. It doesn't always happen, and sometimes it happens just by being in proximity to another player without touching them.
What's going on here?
i dont think they should be math.huge
local BodyPosition = Orb:WaitForChild("BodyPosition") local BodyGyro = Orb:WaitForChild("BodyGyro") BodyGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge) BodyPosition.MaxForce = Vector3.new(math.huge ,math.huge, math.huge)