Offset a CFrame relative to LookVector?

Hello.

I am making a script for a pet that follows you. Right now I have the pet right behind the player:

download (1)

while wait() and player.Character do
	local LookVector = player.Character.Head.CFrame.LookVector
	pet.CFrame = CFrame.new(player.Character.Head.Position - LookVector * 3, player.Character.Head.Position + LookVector)
end

How would I go about offsetting the pet to the left so the pet is not directly behind the player, but rather to the back and left?

I’ve found a pretty bad solution but it works:

while wait() and player.Character do
	local LookVector = player.Character.Head.CFrame.LookVector
	local RightVector= player.Character.Head.CFrame.RightVector
	pet.CFrame = CFrame.new(player.Character.Head.Position - (LookVector + RightVector).unit * 3, player.Character.Head.Position + LookVector * 200)
end

I would suggest just offsetting without using CFrame.LookVector for this

You can translate a CFrame in object space by multiplying it by another CFrame.

For instance if you want it to be 3 units back and 2 units to the right you would do this:

pet.CFrame = player.Character.Head.CFrame * CFrame.new(2, 0, 3)