Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Make a part teleport in front an object facing it?

Asked by 5 years ago

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.

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)) User#24403 69 — 5y
0
Ok but this still sends the model out of the map :( xXrawr_xdXxOwO 24 — 5y

Answer this question