Trouble with weapon system

Hello.

Currently there is an issue with my weapon system,

when RootPart rotation is enabled (RootPart rotation = RootPart orientates relative to mouse position), It seems to move the player forwards, and tilt the torso.

Example:

The movement is not intentional and is not supposed to happen.

When this code here (marked with > ) has comment toggled on, it will cause that to occur:

local lookToPosVector = Vector3.new(mouse.Hit.Position.X,root.CFrame.Y,mouse.Hit.Position.Z)
> root.CFrame = CFrame.new(root.CFrame.p,lookToPosVector)
aocf:FireServer("mouse",{mouse.Hit,mouse.Origin,false}) -- < dont mind this

I don’t know what causes this. (It seems to be the neck and the blade messing with something?)

Any help is appreciated.

Boosting post (char limittttt)

replace with
root.CFrame = CFrame.lookAt(root.Position, (lookToPosVector*Vector3.new(1,0,1))+(root.Position*Vector3.yAxis))

Sadly this does not work. (char limit)

boosting post (char limittttt)

Nevermind, fixed it. RootPart issue.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.