Hello scripters, I am trying to make a host have the same CFrame.Angles as UpperTorso but this script doesn't work.
uis = game:GetService("UserInputService") uis.InputBegan:connect(function(k) if k.KeyCode == Enum.KeyCode.E then char.HumanoidRootPart.Anchored = true local host = workspace.host host.Fire.Enabled = true host.CFrame = char.UpperTorso.CFrame * CFrame.Angles(char.UpperTorso.Rotation) for i = 1,10 do host.CFrame = host.CFrame + Vector3.new(0,0,-2) wait() end host.Fire.Enabled = false char.HumanoidRootPart.Anchored = false end end)
CFrame.Angles interprets stuff in radians with the operation of math.rad(x).
If you'd like to directly input the orientation of an object into CFrame.Angles, the only method I can think of is one that gets a liiiiitle messy. Here:
host.CFrame = char.UpperTorso.CFrame * CFrame.Angles(math.rad(char.UpperTorso.Orientation.X), math.rad(char.UpperTorso.Orientation.Y), math.rad(char.UpperTorso.Orientation.Z))
Hope this helped!