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