Character rotating with tool. How to fix this?
Asked by
5 years ago Edited 5 years ago
I am trying to create a tool that rotates when the player clicks, and have found that when I rotate the tool using CFrames, it causes the player to rotate with the tool. I understand this is to due with the character being welded to the tool, but how do I fix this?
Here is my current script:
01 | local tool = script.Parent |
02 | local main = tool.Handle |
03 | local m = game.Players.LocalPlayer:GetMouse() |
07 | m.Button 1 Down:Connect( function () |
09 | main.CFrame = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.pi,main.Orientation.Y, main.Orientation.Z) |