How to make pet always behind Player

image

image

I’m trying to make a pet following system but when i rotate my character around it stays there and don’t stay behind the player instead it moves to the front of the player or left etc

code:

local player = game:GetService("Players").LocalPlayer
local char = player.Character
local humanoid = char:WaitForChild("Humanoid")
local Root = char:FindFirstChild("HumanoidRootPart")
local Pet = game.Workspace.Pet.PetPart
local RunService = game:GetService("RunService")

RunService.RenderStepped:Connect(function()
	Pet.CFrame = Root.CFrame + Vector3.new(-3,2,-3)
end)
1 Like

try Pet.CFrame = Root.CFrame * CFrame.new(-3,2,-3) instead of adding it with a vector3

1 Like
RunService.RenderStepped:Connect(function()
	Pet.CFrame = Pet.CFrame:Lerp(Root.CFrame:ToWolrdSpace(-3,2,-3), 0.6 )
end)

The other answers are stupid and illogical but they are good. What you should do is put a bodysuit on the mascot and then:

look at the model and there I leave you a script of how to use the body giro

But isn’t bodygyro stuff deprecated

Yes, but they are in the model and Roblox will not remove them

Thats works Thanks but do you mind explaining how it work instead of adding the Position?

well u multiply cframe with cframe to keep its orientation otherwise

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.