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

How do I make a part rotate to the players mouse target? [Not answered]

Asked by 10 years ago

I'm making a gun and wanted the arms to move to the user's mouse location (Can use mouse.Hit or Mouse.Target) . Is there a way I can rotate the part to the target using the parts C0?

(I havent used Cframe in a while :/)

1 answer

Log in to vote
1
Answered by
jakedies 315 Trusted Moderation Voter Administrator Community Moderator
10 years ago

You can use the CFrame constructor CFrame.new(V3, V3).

part.CFrame = CFrame.new(part.Position, mouse.Target.Position);
Ad

Answer this question