Hey, how do i make the pet not be locked on to the player’s position? if the player has an animation that moves the character (i.e player looks down) the pets would move up. I tried raycasting but couldnt make it work.
video:
here is the code:
local x = radius * math.cos(angle)
local z = radius * math.sin(angle)
local y = 0
local offsetPosition = playerCF * CFrame.new(x, y, z)
local petCF = pet:GetPivot()
local newPos = petCF.Position:Lerp(offsetPosition.Position, lerpSpeed)
local newPetCF = CFrame.new(newPos,newPos + playerDirection)
pet:PivotTo(newPetCF)```