I suck at CFrames I don't know what i'm doing. I have a model, I want this model to teleport in front of a part facing it. This is my code

pet:SetPrimaryPartCFrame(CFrame.new(obj.CFrame, pet.PrimaryPart.CFrame, obj.CFrame + pet.PrimaryPart.CFrame.LookVector * -10))

"pet" is the model, "obj" is the part I want "pet" to teleport in front of. This script just teleports the model out of the map. I also want the model to keep it's Y CFrame so it stays in the floor.

2 comments

0

Youn cant construct a CFrame out of a CFrame, so use CFrame.new(obj.CFrame, pet.PrimaryPart.Position, obj.Position + pet.PrimaryPart.CFrame.LookVector * -10))

0

Ok but this still sends the model out of the map :(