I have a pet following script which works fine except for the fact that the pet looks like it’s laying on its back. This is because the front surface is faced upward. What is the best way to rotate the pet vertically within the script and maintain its ability to orient itself horizontally?
--Follow Script
function follow()
local HRootPart = script.Parent.Parent:WaitForChild("HumanoidRootPart")
local BodyPosition = script.Parent:WaitForChild("BodyPosition")
local BodyGyro = script.Parent:WaitForChild("BodyGyro")
BodyPosition.Position = HRootPart.Position + HRootPart.CFrame.lookVector*-4 + HRootPart.CFrame.upVector*-2 + HRootPart.CFrame.rightVector*3
BodyGyro.CFrame = HRootPart.CFrame * CFrame.new(3,0,-3)
end
game:GetService("RunService").Heartbeat:Connect(follow)
Edit: The pet is a MeshPart if that changes anything