I was wondering how I could calculate the orientation a part would face when moving from one xyz position to another given xyz position. I’m not very good with CFrame math, and I was wondering if someone could help me out. I want a pet object to face a target xyz position in space, tweening it’s orientation to face that target position. Thank you!
here you go:
(you will need to set a primary part for the pet model)
local petPosition = petModel:GetPrimaryPartCFrame().p
local charPosition = thePlayer.Character.HumanoidRootPart.Position
local CF = CFrame.lookAt(petPosition, charPosition)
petModel:SetPrimaryPartCFrame(CF)
1 Like
I totally forgot about lookAt! Thank you so much!
1 Like