How do you get a character to not bump into walls?

Hi

Unfortunately I don’t speak English very well

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.

Try detecting the velocity of the character and if it’s too low, stop the animations

1 Like
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)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.