Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

CFrame.Angle not rotating part?

I have a meshpart that looks like a gun and I want it to rotate correctly, but for some reason its not working. There are no errors in the output.

game.ReplicatedStorage.BlitzGunEvents.EquipItem.OnServerEvent:Connect(function(plr)
	    local gun = game.ReplicatedStorage.Guns.AK:Clone()
		 gun.CFrame = plr.Character:FindFirstChild("RightHand").CFrame * CFrame.Angles(math.rad(90),0,0)
	  gun.Parent = plr.Character
	local joint = Instance.new("Motor6D",gun)
	joint.Part0 = plr.Character.RightHand
	joint.Part1 = gun
	game.ReplicatedStorage.BlitzGunEvents.SetUpHumAnims:FireClient(plr)
end)

1 answer

Possibly this would work?

gun.CFrame = CFrame.new(plr.Character:FindFirstChild("RightHand").Position) * CFrame.Angles(math.rad(90), 0, 0)

This discussion is preserved as it was. New answers, comments, and votes are closed.