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


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)) {


Hopefully this is what you were looking for