I would like to remove an attachment when the player loads and assumed this would work, however the player does not update.
new SpinePlayer('spine-player', {
success: function (player) {
player.skeleton.setAttachment('back-attachment', null);
},
...raptor.config,
});
The only way I can make it work is by adding a timeout function
new SpinePlayer('spine-player', {
success: function (player) {
setTimeout(() => {
player.skeleton.setAttachment('back-attachment', null);
}, 100);
},
...raptor.config,
});
Is there a better way of doing this without the timeout?