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

Part's CFrame.Angle ~= Torso's CFrame.Angle?

Asked by 8 years ago

Hi, I'm working on a Telekinesis script where a player is able to click a part, and then control where the part moves, however I'm having a bit of trouble getting the part's rotation to be the same as the players. Basically the player is suppose to be able to click the part, which will weld the part to the player's torso. Then they'll be able to click to move the part, however I'm having trouble setting the CFrame.Angles to match the torso's CFrame.Angles. Here's some of the script:

function MovePart(mouse,hit,pos)
if (pos - hit.p).magnitude <= 30 then
local cp = CFrame.new(hit.p.X, pos.Y, hit.p.Z)
pweld.C0 = torso.CFrame:inverse()*cp -- Can't change the CFrame.Angles here.
end
end

Thanks for any advice!

Answer this question