There is a point that if a player walks into a wall, he bumps into it, but the walking animation is still playing, how can I make it so that this doesn’t happen?
I tried to do it through Raycast but it was unstable there, any ideas?
As an example, I can tell you that this is implemented in DOORS. If you try to run up against a wall and run, the character just stops.
Unfortunately I can’t show you the video, but I think you can see what I’m talking about.
Wall.Touched:Connect(function(hit)
for i,v in pairs( hit.Parent:FindFirstChild("Humanoid"):GetPlayingAnimationTracks()) do
v:Stop()
end
end)
Wall.TouchEnded:Connect(function(hit)
for i,v in pairs( hit.Parent:FindFirstChild("Humanoid"):GetPlayingAnimationTracks()) do
v:Play()
end
end)