How would I make an animation play in c# using code? I am trying to make a button, when the trigger is Entered, the button should play an animation “pressDown,” and when it is exited, it should play “pressUp”. I am using 3d animation imported from blender.
Did you read / watch the tutorials?
Drag your button model into the scene, make sure it has the animations imported from blender.
Attach a new script to it (name it something like ButtonController), attach a SphereCollider (or any other) to it.
Now handle the OnCollisionEnter/Exit messages from the collider, and use the Animator component to play the right animation.