I used the uma asset addon to make a character customizer but now i’m trying to make classes for my games like warrior and mage. I added buttons for each class and animations with bool parameters (should I change the parameter types?) so that when the button is pressed they’ll do an animation representing that class however i don’t know how to connect the buttons so that when they’re pressed the animations activate
I dunno which add-on is that but it’s very simple. What you do is to create a method that holds your animation code. Some thing like this
public void run(){
anim.SetBool("isRunning", true);
}
Then u add the script to an empty game object. Once you’ve don that you go to the button. Now this part depends on you. You might want to make it an onclick or you might wanna make it that it does something on hold and stops doing it on release. To do the former add an onclick function, drag the game object to the function and check you’ll see the method select it. When u play click the button the animation should play. The latter you need to add event triggers. Use onpointerdown for hold and onpointerup for release. Take not that the code shouldn’t be written in the update or start function as this will result to an error. Also make sure you put public to make it visible in the inspector. Hope this helps