Hello!
I am running the script below and the tween is going to the right spot, but it is happening instantly instead of over two seconds. Can anyone think of why this is happening? I am currently converting a project that was using physics over into hard coded animations via tween and I’m running into this issue.
var targetPosition = this.entity.getLocalPosition();
targetPosition.x = targetPosition.x + xComponent;
targetPosition.z = (targetPosition.z + yComponent)*-1;
if (this.tween) {
this.tween.stop();
}
//tween it into the game
this.tween = this.entity.tween(this.entity.getLocalPosition())
.to(targetPosition, 2, pc.Linear)
.delay(0)
.loop(false)
.yoyo(false);
// start the tween
this.tween.start();`