Crawl Animation not working

Hello!
I’m making a crawl script for my game, however it is not working correctly.
it uses an animation, but I can’t get through gaps.

Gif of what I mean: https://gyazo.com/4417ccfdb9eb4ba067d7c376f33b9d98

Script:



game.ReplicatedStorage.Events.CrawlEvent.OnServerEvent:Connect(function(Player,crawlOrNot)
	local Humanoid = workspace:FindFirstChild(Player.Name):WaitForChild('Humanoid')

	if crawlOrNot == true then
		crawlAnim = Humanoid:LoadAnimation(script:WaitForChild('CrawlAnim'))
		print('true')
		crawlAnim:Play()
		crawlAnim:AdjustSpeed(0)
		Humanoid.WalkSpeed = 8
		Humanoid.JumpPower = 0
	else
		print('false')
		crawlAnim:Stop()
		Humanoid.WalkSpeed = 16
		Humanoid.JumpPower = 50
	end
	
	Humanoid.Running:Connect(function(speed)
		if speed > 0 then
			crawlAnim:AdjustSpeed(1)
		else
			crawlAnim:AdjustSpeed(0)
		end
	end)
	
end)

Thanks for any help!

I think it is because of the HumanoidRootPart''s Size.
Here is what you can do play the game and go on to server mode.

Now select your character bodyparts.
You will see a highlighted blue line.

Check the lines are equal to your humanoid when it is standing.

Also one more thing.
Put this code in the part where the player was hitting

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
      print("Part Touched")
   end
end)

Now you can understand if the HumanoidRootPart was touching the part in front

2 Likes