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

How would I create an orientation from a united LookVector?

Asked by
nc2r 117
3 years ago

I want a part to face the LookVector of a CFrame. I am not allowed to change the position at all, just the orientation. The vector I want to set the orientation of the part to is this:

local CastDirection = CFrame.new(RootPos, Vector3.new(ClickPos.X, RootPos.Y, ClickPos.Z)).LookVector.Unit

How can I make that part face the CastDirection?

1 answer

Log in to vote
1
Answered by 3 years ago

part.CFrame = CFrame.new(part.Position,CastDirection)

0
maybe ProjectInfiniti 192 — 3y
0
script.Parent.Touched:Connect(function(hit) Hit = nil end) nc2r 117 — 3y
0
No but close: part.CFrame = CFrame.new(part.Position,part.Position+CastDirection) nc2r 117 — 3y
Ad

Answer this question