Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I differentiate animations during different player terrain interactions?

I am making a game with both terrain water and terrain land. I have made an animation for swimming and right now I've just set the default WalkAnim to that animation. However, I want to make a new WalkAnim and play it when the player is walking on land. How could you tell the difference between land and water and then play the animation for the respective terrain? I'm new to scripting, so take it easy on me please!

Here's the current script (it's nothing special) :

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
    while not player.Character do wait() end
    local character = player.Character
    local animateScript = character.Animate
    animateScript.walk.WalkAnim.AnimationId = 'http://www.roblox.com/asset/?id=555800731'
end)
end)

1 answer

How about you try encasing the terrain in blocks, and put a script in the block that replaces the character's walking animation depending on the terrain that they're in contact with?

This discussion is preserved as it was. New answers, comments, and votes are closed.