Is it possible to use Tween.js with getPosition instead of getLocalPosition? I can’t use Local positions in this situation
The target entity is constant child of another entity
I can’t add another entity as a child to get dummy pos, any other ways?
Thanks
var mat = this.entity.parent.getWorldTransform().invert(); // get inverse world transform of parent
var worldPosition = this.entity.getPosition();
var localPosition = new pc.Vec3();
mat.transformPoint(worldPosition, localPosition);
console.log('Calculated pos');
console.log(localPosition); //x:0.22019599035674275y:-0.4319997904002637z:0.15780184727611868
console.log('Actual local pos');
console.log(this.entity.getLocalPosition());//x:0.22019599035674y:-0.43199979040026z:0.15780184727612
I’ve got another one, is there any chance tween would work with rigidbody as well?
Or should I just update its position with prototype.update and rigidbody.teleport
Not sure why but seems like Tween.js rewrites every possible Vec3 property stored on entity once this.tween.stop(); happens, strings are fine, took a while to notice it