Hello. When I use the rotate function, the rotation occurs immediately. But after moving forward, a new turn does not occur immediately, but after a few seconds. Tell me what the reason is?
Mover.prototype.rotation = function(direction){
const dir = direction === 'left' ? 1 : -1
this.entity.rotate(0,3*dir,0)
}
Mover.prototype.walk = function(dt){
const forward = this.entity.forward.clone().scale(-0.0008)
const currentPos = this.entity.getPosition().clone()
const pos = this.entity.getPosition().add(forward)
this.entity.rigidbody.teleport(pos)
}
And yet, you do not know why when colliding with a rigid wall, the object continues to pass inside, but if you stop in time, it will push back.