avirzayev

I am developing a 2d shooter game. The character in the game can switch between different skins and use different weapons.
Each weapon has a different animation and also different character animation. The character holds pistols with his right hand and rifles with both of his hands.
I have created the character's skeleton and added skins to it. I am struggling with adding weapons attachments and animations.
Because my weapons have different animations it means they will have different bones. Should I create them inside the player skeleton and show only one in the code? How will it affect different animations?
What is the best approach to solving this? I want that the outcome will be that for every skin will be all the weapons shooting animations.
avirzayev
  • Postovi: 1

Misaki

Hi,

Skins allow you to switch active bones by adding the bones to one or more skins. You can add the bones for each weapon to each skin and you can hide inactive bones in the viewport using the Hide viewport skin bones option.

Also, skin constraints will help you to switch the character’s pose for each weapon. You can use transform constraint for each skin to make your character hold a weapon to match the gun-mount position.

See the user guide for more information:
Skins - Spine User Guide: Skin bones
Skins - Spine User Guide: Skin constraints

How to use constraints to hold a two-handed weapon is explained in this blog post:
Blog: Holding a two-handed weapon

I hope these will help.
Avatar
Misaki

Misaki
  • Postovi: 769


Natrag na Editor