So my task is to make sure that when you click on the left mouse button playing an animation of how player throws dynamite forward. I have already made clicking the left mouse button to play the animation, but I have a problem. Dynamite flies to the wrong place, that’s what it does:
Here’s how I did it. This is where the dynamite lies:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local bombModel = game:GetService("ReplicatedStorage")["TNT STICK"]
local explosionAnimation = game:GetService("ReplicatedStorage").Throwing
local motor6D = game:GetService("ReplicatedStorage").Motor6D
local function throwBomb()
local Humanoid = player.Character:WaitForChild("Humanoid")
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if Animator then
local clone = bombModel:Clone()
clone.Parent = player.Character.RightHand
motor6D.Parent = player.Character.RightHand
motor6D.Part0 = player.Character.RightHand
motor6D.Part1 = player.Character.RightHand["TNT STICK"].Circle
local animation = Animator:LoadAnimation(explosionAnimation)
animation:Play()
clone.Active.Value = true
wait(1.5)
motor6D.Parent = game:GetService("ReplicatedStorage")
clone:Destroy()
game:GetService("ReplicatedStorage")["TNT STICK"].Active.Value = false
end
end
So again, the problem is to make the dynamite fly forward instead of upwards. And the second task is to make it so that when it lands or touches the desk, it explodes
Yes my animation is how the nps moves and throws dynamite that flies. I animate both nps and part, but for some reason it does not fly as in the animation
tips to make an animation, do not move the feet without moving the body, it looks unrealistic and badly done, that the movement is really useful to do, to throw a rod there is no need to raise the hand so much, one as a person looks for the easiest angle to throw and that angle would be sideways, when you go to make an animation of that type is for viewmodels, what interacts with the view and the workspace must be converted into 1 in one way or another, but as you do not use viewmodels is simpler. and last tip: realistic movement, when you move the hand backwards make it fast, then a few seconds of frame grab a little more momentum slowly, then, start to pull it slowly in a process of 2 frames, add the speed in the next 2 frames and then go up to the fastest possible in the remaining ones, so if it looks good.