I am having trouble making a sliding mechanic I don,t know how to make code that will scale down your player when SHIFT is pressed I am struggling please help

playcanvas.com/editor/scene/968623

Myscript.prototype.initialize = function(dt) {
this.PlayerHeight = this.entity.getLocalScale();
// getting the players Height 
this.ScaleDownFactor = 2
// the number by which the playerHeight gets divided to 

}
Myscript.prototype.update = function(dt) {
if (this.app.keyboard.isPressed(pc.KEY_SHIFT)) {
this.entity.setLocalScale(this.PlayerHeight.x,this.PlayerHeight.y/this.ScaleDownFactor,this.PlayerHeight.z);
}

};

Hopefully this is what you were looking for