let pos = this.characterMedium.getPosition();
if (this.lane == "left" && this.app.keyboard.wasPressed(pc.KEY_D)) {
this.characterMedium.rigidbody.teleport(pos.x + 6, pos.y, pos.z);
this.lane = "right";
}
else if (this.lane == "right" && this.app.keyboard.wasPressed(pc.KEY_A)) {
this.characterMedium.rigidbody.teleport(pos.x - 6, pos.y, pos.z);
this.lane = "left";
}
With this code, I move my player to the right and left, but the rigidbody does not move to the right and left, why?