I am trying to teleport a body back to it’ s initial spot after it falls off the ledge.
This works for the first time, but for second time it continues falling and isn’ t returning to the initial position.
What would be the correct way to do this?
checkHeraldPosition() {
if (this.herald && this.herald.position.y < -10) {
this.heraldAggregate.body.disablePreStep = false;
this.heraldAggregate.transformNode.position = this.initialPosition;
this.heraldAggregate.transformNode.rotation = this.initialRotation;
this.heraldAggregate.body.setLinearVelocity(new BABYLON.Vector3(0, 0, 0));
this.heraldAggregate.body.setAngularVelocity(new BABYLON.Vector3(0, 0, 0));
}
}