[SOLVED] Spine > How to change attachments at runtime? (customization system)

Hi!

I’m currently running tests with Spine (more accessible than I thought :slight_smile: which is great). And congratulations on the extension! Super easy to use.

Now I can create (basic/awful) idle/walk animations in Spine and use them in Defold.

What I’d like to do now is to change items to customize my characters at runtime (equipment, weapons, hair etc.)

Ex in my test: I want to replace the sword with a mallet.
image
replaced with this:
image

In the Spine documentation I found this:

My slot is “weapon” and here are my 2 attachements:
image

In Defold I wrote this:
image

But it doesn’t work.
image

Not sure what I should do at this point :thinking: . . .

The error message tells you you didn’t specify the instance, i.e. the url.

If you look at the documentation in the extension (a.k.a. the auto complete):

https://github.com/defold/extension-spine/blob/eb056bb832c3d9a351ab4858d18cd893e5bb9243/defold-spine/api/spine.script_api#L163

1 Like

Also documented here:

1 Like

Thanks :slight_smile: (it works now)

Maybe you should update this one?
image

Thx. Yes, I fixed that now.

3 Likes