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

What am I doing wrong with this CFraming operation?

Asked by
drew1017 330 Moderation Voter
8 years ago
root.CFrame = CFrame.new(root.CFrame.p, mouse.hit.p * Vector3.new(1, 0, 1) + Vector3.new(0, root.CFrame.p.y, 0)) * CFrame.Angles(0,math.rad(212),0)

This code as you can see rotates the root part so that it faces the mouse (courtesy of YellowTide), and it works perfectly... except for the fact that this code ALSO causes the root part to physically move to the side. It's not supposed to move at all, and I have no idea what could be causing it. halp

And yes, i've confirmed it's this code that's causing the movement and not something else.

Answer this question