Character jumps back to original position even when I'm holding the keys

My character, every time I press, WASD, it keeps going back to the original position even though I am holding down on the said buttons. How to fix this? I want it to stop walking only when I released the buttons.

My linear damp is set to 0.99
This is my code:

var GirlAnimation = pc.createScript('girlAnimation');

// initialize code called once per entity
GirlAnimation.prototype.initialize = function() {

};

// update code called every frame
GirlAnimation.prototype.update = function(dt) {


//W
if (this.app.keyboard.wasPressed(pc.KEY_W)) {
    this.entity.anim.setBoolean("isWalking", true);

    this.entity.setEulerAngles(0,0,0);

}

if (this.app.keyboard.wasReleased(pc.KEY_W)) {
    this.entity.anim.setBoolean("isWalking", false);

}

//A

if (this.app.keyboard.wasPressed(pc.KEY_A)) {
    this.entity.anim.setBoolean("isWalking", true);

    this.entity.setEulerAngles(0,90,0);
}

if (this.app.keyboard.wasReleased(pc.KEY_A)) {
    this.entity.anim.setBoolean("isWalking", false);
}


//S

if (this.app.keyboard.wasPressed(pc.KEY_S)) {
    this.entity.anim.setBoolean("isWalking", true);

    this.entity.setEulerAngles(0,180,0);
}

if (this.app.keyboard.wasReleased(pc.KEY_S)) {
    this.entity.anim.setBoolean("isWalking", false);
}

//D

if (this.app.keyboard.wasPressed(pc.KEY_D)) {
    this.entity.anim.setBoolean("isWalking", true);

    this.entity.setEulerAngles(0,-90,0);
}

if (this.app.keyboard.wasReleased(pc.KEY_D)) {
    this.entity.anim.setBoolean("isWalking", false);
}


};

Hi @zero2!

This probably happens because you can’t use setEulerAngles on an entity with a dynamic rigidbody. Instead, you can use teleport on the rigidbody of the entity.

var pos = this.entity.getPosition();
var rot = this.entity.getEulerAngles();

if (this.app.keyboard.wasPressed(pc.KEY_A)) {
    this.entity.rigidbody.teleport(pos.x, pos.y, pos.z, rot.x, rot.y + 90, rot.z);
}