I am working on creating climbable ropes, but i cant figure out how to get the climbing animation working correctly.
How do i make the player climb depending on the movement?
This is how i do it right now:
Humanoid:ChangeState(Enum.HumanoidStateType.Climbing)
Humanoid.StateChanged:Connect(function(oldState, newState)
if IsClimbing == true and newState ~= Enum.HumanoidStateType.Climbing then
Humanoid:ChangeState(Enum.HumanoidStateType.Climbing)
end
end)
This is most likely a bad idea and won’t work but you can try adding invisible cylinder parts inside the rope that stick out. If that is not something you want to do you can also look into how other people make ladders.
Oh yeah my bad. You can try to call the animation to see if there really is a difference or not. I know ChangeState should handle it but personally have had some issues in the past. Other than that I am not too sure and don’t have much experience with ladders myself. Looking at it again a suggestion is to try disable any falling states to avoid overriding the climbing.
i think this could help :D. this script help me with the climb animation :
local isClimbing = false
humanoid.StateChanged:Connect(function(_oldState, newState)
if newState == Enum.HumanoidStateType.Climbing then
if not isClimbing then
isClimbing = true
climbAnimTrack:Play()
idleAnimTrack:Stop()
runAnimTrack:Stop()
jumpAnimTrack:Stop()
end
elseif newState == Enum.HumanoidStateType.Landed then
if isClimbing then
isClimbing = false
climbAnimTrack:Stop()
idleAnimTrack:Play()
end
end
end)