How to change player's sprite and animation on collision?

Hi guys, i am developing a 2d platformer android game on unity and i wan to change my player’s sprite to auto equip the mask when the player collides to it, do you guys know how to do it?
E.g. the player’s sprite will show the mask equipped when it collides with the game object (mask)

Making a pickup will need several steps, it isnt “out of the box” functionality. Detect a collision between the player and the mask, delete the mask prop from the scene, write in some “character status” script that you’ve picked up the mask, and finally update the character graphics accordingly.
Detection is the easier part; you need a trigger collider on either player or pickup object, and then you run your detection related code from OnTriggerEnter method:

Displaying the equipped object on 2d character can be either easy or insanely hard depending on how this character is made. If it is a flat polygonal puppet with a skeleton, you can have the mask sprite be parented to the head bone, keep its GameObject disabled by default, and then enable it when it needs to be visible. If your character is drawn frame by frame, tough luck; you’ll have to redraw the masked version of all the character animations.

I have already drawn the masked version of character animations, the problem is that idk how to implement it into my character when it collides with the mask. I have searched youtube for tutorial but all i can find is changing the character sprite on collision which is not exactly what i want

For the masked version of the character animations, do i need to connect them onto the animator controller as well?

I havent worked with 2d animations to be honest. If controller behaves in any way similar to 3d, you can either create new animation tree on another layer and enable/disable it from script, or create second tree on the same layer and switch to its initial state using Animator.CrossFade.

Note that 2d animations cannot be mixed together, so I am not sure how exactly layer weights or CrossFade transition duration will behave. In theory, toggling weights between 0.0 to 1.0 or setting translation duration to zero should give the desired effect.

Does your character even use Animator component? I automatically assumed it does, could be wrong

Yes, thx for the tip!

sorry for the late reply,
FYI, i already solved this by following this tutorial, thx for the help!