PeterBacall

Hi!

I'm creating a shooter. In Spine I've added a bone at the tip of the gun, which is the fire point. In Unity I use this fire point as the "bullet spawn position". Because then it would update correctly with my characters rotation, animation etc... I later realised this approach would be messy in the long run, when adding several gun attachments. For example:
In Spine, I've created a unique fire point bone for each attachment, which is then added to the skin. There's also a "main fire point" which has a Transform Constraint (100% mix) for each fire point. When I toggle between the skins, the main fire point updates to the correct fire point.
In the long run, I'll have 25 weapons, but then I'll have 25 fire point bones and 25 Transform Constraints.

Is there a better way of setting this up in Spine? If I could create folders in the Constraints list, I could tuck them away.

All suggestions appreciated!

Edit: Just a thought, If bones added to skins could also have unique transforms for each skins, it wouldn't be necessary to create several bones and transform constraints, but then maybe it would be messy for animations...
PeterBacall
  • Messaggi: 84

Søren

I think what you're already doing might be the best solution. Although, another solution would be to create a 1 frame animation that positions the fire point correctly for each weapon.

Alternatively you could also remove the skins and keep the transform constraints, then at runtime you could manually set the mix position for the correct transform constraint.
Avatar utente
Søren

Shiu
  • Messaggi: 2451

Erika

If the fire point is only used in unity to spawn bullets, then a possible solution is to use point attachments, which can be placed in a skin, share the same name, and have translation and rotation.
Point attachments - Spine User Guide
Avatar utente
Erika

Erikari
  • Messaggi: 3085

PeterBacall

Awesome, thank you Erika and Søren
PeterBacall
  • Messaggi: 84


Torna a Unity