Movement mechanics, need some help!

Hello, so I’m making an ice skating game, and I’m really working on making the movement mechanics on the ice.
Basically, I need different animations for going forward, sideways, etc.
So I’m sort of using keys like you would for keybound animations, but It doesn’t seem to be working. Can anyone help me out?
Also, a few additional questions if you could help:

  1. Will this work on mobile? Do keybinds only apply to PC when involving movement?
  2. How would I possibly go about adding an animation at the start of every walk animation? (Kickoff to glide in skating.)
    Any help is much appreciated!
local animateScript = character:WaitForChild("Animate")
 
-- Change the defaut walk animation:
animateScript.walk.WalkAnim.AnimationId = "rbxassetid://6184265509"
 
-- Walk Backwards animation when pressing S:
  UIS.InputBegan:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.S then
		animateScript.walk.WalkAnim.AnimationId = "rbxassetid://6186792702"
	        end
    end
  end)
	 
	-- Reset Forward animation when release S:
	UIS.InputEnded:Connect(function(key)
    if key.KeyCode == Enum.KeyCode.S then
	        animateScript.walk.WalkAnim.AnimationId = "rbxassetid://walkanim3"
        end
	end)


Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like