Character customization

Hey there fellow Defold masters,

I have one question for you: how would you approach character customization with multiple pieces and functionality? Let’s say a player that can change his hat, weapon, a few other visual bits around, plus functionality (shooting different projectiles or changing completely a weapon).

With everything that needs to be created upfront and as a go, I’m finding it difficult to wrap my head around the concept, as I would normally try to deal with it at runtime.

Thanks a lot!

Gianmichee

There was a thread a little while ago about making a weapon system, you could use one of the suggested methods for cosmetic stuff too.

1 Like

I would (and have) approach it like this:
Create a barebone unit in spine. Wherever you want to attach things (hat, weapon) you have added a bone in spine.
In your main gameobject containing the spineobject I would attach new gameobjects to that bone (spine.get_bone). This doesn’t scale very well in the end if there are hundreds of very different gameobjects as it would force you to have hundreds of factories but if you have plenty of items but with kinda the same functionality you will be able to create a gameobject which you can skin with flipbook animations and tweak with go.properties.

2 Likes