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

How can I make a welded object look at a certain position?

Asked by 6 years ago

Lets say I have a turret and the weld does not have any certain CFrame, it is welded directly to a part (turretbase).

I want the weld to "look at" my mouse.Hit, how would I do this?

I tried...

C0 = CFrame.new(turretbase.CFrame.p,mouse.Hit.p)

...it spazzed.

1 answer

Log in to vote
0
Answered by 6 years ago

A friend answered this for me,

C0 = part0.CFrame:inverse()
C1 = CFrame.new(part0.CFrame.p,hit.p)
Ad

Answer this question