Don't know how to rotate gun

Hi! I am new to animations and tools.
Here is a picture of my animation and my gun (which is a model), as u can see gun is inside the arm, that’s because I inserted motor6D (it’s parent is RightHand), with part0 RightHand and part1 BodyAttachment (this part is supposed to be a handle of the gun and is inside of gun model).


also I don’t want to use a tool in the backpack, because I don’t want to use the tool Icon, also I am aware of SetCoreGuiEnabled(), but I gave up on it because it disabled access to tool.
RobloxScreenShot20200408_114740598 (2)
My question is how can I rotate a gun?
also here is my local script:

local UIS = game:GetService("UserInputService")
wait()
local pr = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")

UIS.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.E then
		local animation = game.Workspace.Animation
		local anim = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(animation)
		anim:Play()
		wait(0.22)
		
		local idle = game.Workspace.Idle
		local playIdle = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(idle)	
		playIdle:Play()
		
		local motor6D = Instance.new("Motor6D", game.Players.LocalPlayer.Character:FindFirstChild("RightHand"))
		motor6D.Part0 = game.Players.LocalPlayer.Character:FindFirstChild("RightHand")
		motor6D.Part1 = game.Workspace.Gun.BodyAttach
		motor6D.Name = "HandleMotor6D"
	end
end)

Thanks for help!

1 Like

When you mean rotate, do you mean animate?

When I press “E”, I want to have a gun nicely placed in my hands.

Equip the gun in-game, and observe the orientation it needs to be rotated.
In the workspace, reparent the tool to the workspace and rotate the Handle object in the gun in that orientation and just approximate the angle it needs to be to face straight. Most likely you’ll get this right.

maybe try changing the grip of the tool. I dont know if thats how it works.

Thanks! I end up rotating BodyAttach as u suggest and changing DesiredAngle in my motor6D.