Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I differentiate animations during different player terrain interactions?

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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?

Ad

Answer this question