Making A Pet Stay In Place Using BodyPosition

I’m trying to use BodyPosition to make the pet stay in place. All parts in the model are set to CanCollide = false and Anchored = false.

   BinableEvent:Fire(character)
			ClonedPet:SetPrimaryPartCFrame(character.HumanoidRootPart.CFrame:ToWorldSpace(CFrame.new(-3,-1.5,0)))
			ClonedPet.Sphere.BodyPosition.Position = ClonedPet.Sphere.Position
			ClonedPet.Sphere.BodyGyro.CFrame = ClonedPet.Sphere.CFrame

No errors show in the output.

Thanks!

Assuming that your model’s parts are all welded together, you would want to create a BodyPosition and Parent it to the main part of the pet. Then you would grab the positions of the main part and set the BodyPosition’s Position as that Position.

For Example:

local pet = script.Pet
local bp = Instance.new('BodyPosition')
bp.Position = pet.PrimaryPart.Position
bp.Parent = pet.PrimaryPart

Alternatively, you could just anchor the primary part of the pet.

I already have the BodyPosition in the part like this
image
I’m not anchoring the pet because I want it to move and animate.

Ok, then set the BodyPosition to the Sphere’s Position. You may also want to set its MaxForce to something like (10000,10000,10000).

It’s still just falling for some reason.

Try adding some zeros to the BodyPosition’s Maxforce. If that doesn’t work, you may need to set all of the parts’ mass to 0.

1 Like

Okay it worked when I changed the MaxForce to 100,000. Thank you.