Hmm, I tried waiting half a second before I re-enable it but it didn’t seem to work. I also tried scaling it to zero and back again when it finds the image but I always get that last frame playing once before the anim starts.
Perhaps 8th wall is doing something odd with it?
Out of interest, does ‘entity.enable’ actually disable/enable the entity and scripts components on the entity or just set its visibility?
Made the playAnim.js script into a general controller script so it’s not on entity that is disabled when the tracking is lost.
Disabled the particle effect and spine entity when the image is lost.
Enabled the particle effect and spine entity on the next update frame after the image found event is fired. Animation is played in this update frame
The image found event is probably fired AFTER the spine system update so enabling the spine entity then shows the spine entity for that frame but the logic to set it’s state/colour/position etc isn’t done till the next update frame.
Hi, with this code I’m trying to add some other simple simple actions (disabling some object or starting a tween) to happen at the start of the app but its not working. Something to do with this skipping the first frame code that I don’t understand I think.
I’ve tried inside the postInitialize function and/or creating a new OnInitialize function but the commands don’t seem to run in either of those. Its very odd.
I shared the project with you.
You can see on lines 33 (postInitialize) and 136 (update) of playAnim.js that I tried to start the tween without success in both cases…
I’m expecting the scan graphic (square in centre of screen) to be pulsing at the start of the app in a continuous loop.
Hmm, okay, I deleted a bunch of stuff but Its only 2 meg smaller (there’s not really that much in the project) so I’m not sure why its 38meg.
The problem is that I’ve tried inserting the following line inside Initialize, the PostInitiliaze AND the Update functions (inside the first frame only) but it never seems to trigger in any of those functions.