Hello there, I’m having a trouble fixing a glitch.
-
What do you want to achieve? I want to create a grabbing and throwing move.
-
What is the issue? There happened to be an unexpected bug after the animation.
-
What solutions have you tried so far? I have tried teleporting them back, there was no specific solution for this problem.
So, I’m making a move that allows you to grab the enemy, throw and detonate them. The user’s HumanoidRootPart would be anchored during the move in order to stand still and balanced. I was messing around with the move until I found out shift-locking and turning to a different direction would cause the target to teleport after removing the WeldConstraint.
It’s normal when I don’t turn:
This happens when I turn to any direction:
Please excuse the videos’ bad quality and FPS.
Here is the part that handles the throw.
-- Char: The user's character, chr: The target's character
Char.HumanoidRootPart.Anchored = true
chr.Status.Value = "Disabled"
local explosive = Char.Humanoid:LoadAnimation(extraanimation)
explosive:Play()
wait(0.5)
chr.HumanoidRootPart.CFrame = stand.BeatdownWeld.CFrame
local weldcons = Instance.new("WeldConstraint", stand.BeatdownWeld)
weldcons.Part0 = stand.BeatdownWeld
weldcons.Part1 = chr.HumanoidRootPart
explosive.Stopped:wait()
weldcons:Destroy()
chr.Status.Value = "Active"
explosion(chr, 60)
indicate(chr, tostring(60), Color3.fromRGB(212, 49, 0))
Char.HumanoidRootPart.Anchored = false