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.
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!