Spine play new animation after a specific animation has finished

When I mean smaller project, I mean by having the bare minimum to reproduce the issue. For example, can the XR stuff be removed so someone could quickly debug on desktop. That alone would help a lot as someone wouldn’t need to hook up a mobile device for debugging etc.

Oh I see sorry. I misunderstood.

ANyway, for now I’ve put the tween inside another script which seems to work fine but I’m curious to know why it didn’t work in the PLayAnim script.

Thanks

With this information you can rule out many possible causes.

Is the script added to an entity? Otherwise the script will not be executed.

@Grimmy I’ve had a quick look.

Are you expect the scan border to pulse when you start the app?

PlayAnim.prototype.postInitialize = function() {

    this.buttons_on_screen=false;
    
    //PULSE THE SCANNER GRAPHIC - THIS ONLY WORKS AFTER THE IMAGE HAS BEEN SCANNED?!?!?
    this.scan_border.tween(this.scan_border.getLocalScale()).to(new pc.Vec3(0.95,0.95,0.95), 0.5, pc.SineInOut).yoyo(true).loop(true).start();
    
    this._spine = this.entity.findByName('Spine Entity');
    this._playNextFrame = true;
    //this.instruction_text.enabled=true;

The reason is because the script is attached to the entity ‘Image Target Red Packet’. That entity is disabled on start. Probably by ‘namedimagetarget.js’

As that is done on the initialise step, the postInitialize functions for the scripts on that entity are not called and therefore your tween isn’t called until you start tracking the image and the entity is enabled.

The order of the scripts on the entity also matter as they are called in that order:

namedimagetarget initialize is called first
playAnim initialize is called second

Okay I had no idea that the entity was being disabled at the start. This will be to do with the 8th Wall AR integration.

I suppose it must be the external 8thWall script that is disabling it when namedImageTarget calls the function XRExtras.PlayCanvas.trackImageTargetWithName(this).

Thank you so much!