I am using changeScene() to change a scene, each scene has different scripts running on an entity.
I have the problem that the script continues running when the scene changes.
How can I avoid this so that the script will restart each time I change the scene?
It works now so far. It was some issue with the entity. Only thing now is that I cannot fully destroy the tweens / tween js. The tweens are kinda going crazy when I change the scene and switch back. As mentioned in the headline of this thread, I am using Engine only (and Vue3).
I do something like this in my Script in the initialize function:
for (i = 0; i < this.tweens.length; i++) {
if (this.tweenInstances[i]) {
this.tweenInstances[i].stop();
this.tweenInstances[i] = undefined;
}
}