var Bpos=this.app.root.findByName('Inn').getPosition();
var Brot=this.app.root.findByName('Inn').getEulerAngles();
if (Brot.y===0) {
this.entity.rigidbody.teleport(Bpos.x-1,2.5,Bpos.z-2.2);
this.entity.setEulerAngles(0,Brot.y+180,0);
}
Also if i keep changing the Brot.y+(value) the player don’t rotate properly…pretty frustrating.
The code get the position and rotation of a building (Inn in this case) and move the player to a specific location and rotate it in the right direction too, since the position and rotation of building change also the positioning of player have to change according. Actually the position is ok but the rotation don’t change as it should.