I cant trigger the animation in mobile. it wont work?

This is the script when i even try to trigger the animation in mobile it wont work i tried to fix it but some how i cant get it to work. so im asking for some help :slight_smile:

Remove UserInputService. There’s no need for it. ContextActionService does the exact same thing as UserInputService, except it creates a mobile button. You’re calling the onButtonPress() function using ContextActionService, but inside of that function, you’re using UserInputService. Since you’re using an if statement to check what the key is, it results in it not working on mobile, because the if statement is returning false, because the player hasn’t pressed a key. They tapped the button, not a key.

Like this?

1 Like

Yeah, I’m pretty sure that should work. Test it out, and tell me if it works.

It wont work. when i try to test it and press the button it doesnt work

do you have any ideas to fix it?