Open
Description
Hi, thanks for this great lib its really useful!
But i've fallen into some trouble that i cant figure out. Within my three.js scene i have camera and avatar objects in a container object that is moved with my controller. On collision with another object in my scene the camera is meant to tween back and up slightly but instead of any animation it just jumps to the finished position.
This only happens while the avatar is being moved, if i initiate the tween straight away when the avatar isn't being moved the animation runs fine.
Is anybody aware of what might be causing this? and a possible fix? I'm truly stumped
This is the tween setup code i'm using incase its just a simple setup issue i've missed:
var camPosition = { x : 0, y : 5, z : 50 };
var camTarget1 = { x : 0, y : 10, z : 75};
tweenCamToOrig = new TWEEN.Tween(camTarget1)
.to(camPosition, 2000)
.easing( TWEEN.Easing.Back.InOut )
.onUpdate(function(){
camera.position.x = camPosition.x;
camera.position.y = camPosition.y;
camera.position.z = camPosition.z;
})
.onComplete(function(){
});