Change Character Skin

Basically exp: Player is in “Shop”
clicks on “Santa Skin”
I need a way for If player has enough “coins or points” they are able to purchase
“Santa skin” from Shop.
with in game currency.
and if they have enough “points or clicks” and they “click or purchase” the “Santa Skin”
it will change the original “default” player sprite to the newly purchased “Santa Skin Sprite”.

Add each skin as a separate animation for the character. Then change the animation number to change skin.

If you have different animations for different actions, then you should use a base animation value (as an object variable) and an animation offset to get the right action for each skin:

So, say you have a default 4 animations - idle, left, right & jump. These will have animations numbers 0, 1, 2 & 3. You’d set the player’s object variable BaseAnimation = 0.

If you add the santa skin, put the animations in order of idle, left, right and jump. These would have the animation numbers 4, 5, 6 & 7, and you’d set the player’s object variable BaseAnimation = 4

If you then added,say, a goblin skin, again have the animations in order of idle, left, right and jump. These would have the animation numbers 8, 9, 10 & 11, and you’d set the player’s object variable BaseAnimation = 8 (see the pattern?)

To then set the correct animation based on the skin used:
When player is idle, set the animation to player.Variable(BaseAnimation)
When the player is moving left, set the animation to player.Variable(BaseAnimation) + 1.
When the player is moving right, set the animation to player.Variable(BaseAnimation) + 2
When the player is jumping, set the animation to player.Variable(BaseAnimation) + 3.

1 Like

thank you very much!