I suck at scripting so please bare with me.
{When I refer to the “Character”, I am talking about my custom monster character I made}
Basically I am trying to make a jumpscare for a horror game with 3 different animations.
The Jumpscares work perfectly as intended, but whenever they start playing, my character just zooms back until he hits a wall. I do not know how to fix this
local db = false
local Monster = game.Workspace.Cutscene.Monster
local Jumpscare = game.Workspace.Cutscene.Monster.Torso.Jumpscare
local getUp = game.Workspace.Cutscene.Monster.Torso.GetUp
local Kneel = game.Workspace.Cutscene.Monster.Torso.Kneel
local humanoid = game.Workspace.Cutscene.Monster:WaitForChild("Humanoid")
local KneelPlay = humanoid:LoadAnimation(Kneel)
local getUpPlay = humanoid:LoadAnimation(getUp)
local JumpscarePlay = humanoid:LoadAnimation(Jumpscare)
KneelPlay:Play()
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if not db then
db = true
hit.Parent:FindFirstChild("Humanoid").WalkSpeed = 0
KneelPlay:Stop()
getUpPlay:Play()
Kneel:Destroy()
wait(6)
getUpPlay:Stop()
JumpscarePlay:Play()
task.wait(20)
db = false
end
end
end)
Video of my Problem:
Him sliding back into the wall is my issue. If anyone has any fixes please let me know!