If the entity is a dynamic rigidbody, then the physics simulation controls the rotation and position of the entity. This means that functions like entity setPosition and lookAt won’t work or give odd results.
A new warning was added to engine 1.62 when users try to use these functions on dynamic physics objects.
The key point here is that a dynamic rigidbody position and rotation is fully simulated by the physics. Setting the rotation and position directly on the entity will not work as that gets overwritten by the physics.
This warning is to prevent users from getting confused when they try to do this but nothing happens because the physics simulation is directly setting the position and rotation of the Entity.
Generally, users should not be using teleport every frame because that can affect the simulation but if you want to go down that route either use kinematic rigidbody so you can set the position and rotation directly.
Or use a Mat4 to calculate the position and rotation. eg:
this.lookAtMat4 = new pc.Mat4();
this.lookAtMat4.setLookAt(this.lookAtMat4.getTranslation(), this.lookAtPosition, pc.Vec3.UP);
var forward = this.lookAtMat4.getZ().clone().mulScalar(-1);
var right = this.lookAtMat4.getX();
But I’m changing another entity ‘devEntity’ without ‘Rigidbody’, which I specifically created in order to use ‘lookAt’ with it.
Then I take the angles of ‘devEntity’ and apply their values through ‘teloport’ to the main entity.
Aside from the warning note, changing an entity scale on a dynamic rigidbody component is a feature with an undefined behavior. The engine can only change the scale of the model, but Ammo cannot change the shape. If someone wants to change the scale of an entity, one would probably mean to scale both the body shape and the visual model. I’d say the engine shouldn’t support changing the scale, if the physics engine doesn’t support it.