I want the player to stop suddenly while having a vector force, and also have that force dissapear. If I were to simply anchor the HRP, once I unanchor it the force is still applied. This is my code:
local function CheckTouched()
for i, v in pairs(workspace:GetPartsInPart(x)) do
if v.Parent:FindFirstChild("Humanoid") and v.Parent ~= Character and v.Parent:FindFirstChild("DashHit"..Player.Name) == nil then
Character.HumanoidRootPart.Anchored = true
x:Destroy()
timer = 0
playdashanim:Stop()
local dashland = Instance.new("Animation")
dashland.AnimationId = 'rbxassetid://14567880431'
local playdashland = Character.Humanoid:LoadAnimation(dashland)
playdashland:Play()
vf:Destroy()
touched = true
local x = Instance.new("IntValue", v.Parent)
x.Name = "DashHit"..Player.Name
game.Debris:AddItem(x, 1)
dashevent:FireServer(v)
wait(1)
Character.HumanoidRootPart.Anchored = false
playdashland:Stop()
break
end
end
return false
end
Side note: VF (vectorforce) gets destroyed before this function happens. I’ve also tried just making a new vector force that is the opposite of the current one, but it does’nt seem to work.
Please help!