i am confused by what you mean dosn’t work on mobile as it should be replicated to any device i have modifed your code with the roblox docs code and left the reference below
script.Parent.Activated:Connect(function()
local animationTrack = game.Players.LocalPlayer.character.humanoid:LoadAnimation(animation path eg script:WaitForChild("animation"))
if script.Parent.Text == "Sprint" then
script.Parent.Text = "Walk"
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30
animationTrack:Play()
else
script.Parent.Text = "Sprint"
game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
animationTrack:Play()
end
end)
I did not specify that when I play my game on pc and I press the shift key there is the sprint animation that plays and when I am on mobile and I press the sprint button it works but I will want to who has sprint animation
i am sorry but i dont quite understand the question could you please rephrase it the part in bafled by is
what exactly do you want does the animation not work or do you want to select certain players who can use the sprint animation i am sorry i dont understand
it should unless your useing a seperate script for mobile players. by that i mean do you have a seperate script for when the shift button is pressed on mobile if so copy the script for pc to that one