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)

1 comment
You could also use the inherited components of the CFrame and negate the position field. Such an example could yield: p2.CFrame = CFrame.new(p2.Position, select(4, p1.CFrame:components()))