A script for making an object move faster

Im new to this and this is for a school project I have found some other scripts but I cant seem to figure out how to increase the speed that the object moves. Here is what I’m using now(I’m doing a 2D game)

var Movement = pc.createScript('movement');

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

};

// update code called every frame
Movement.prototype.update = function(dt) {
    // get which keys are pressed
    var keyboard = this.app.keyboard;
    var left  = keyboard.isPressed(pc.KEY_LEFT);
    var right = keyboard.isPressed(pc.KEY_RIGHT);
    


    // move this entity based on which keys are pressed
    // dt is the time in seconds since the last frame and stands for 'delta time'
    if (left) {
        this.entity.translate(-dt,0 , 0);
    }
    if (right) {
        this.entity.translate(dt, 0, 0 );
   
    }
};

I tried added a z coordinate for moving but it didn’t do anything.

Try to use translateLocal instead of translate. This only works if you use an entity with a kinematic rigidbody. If you use an entity with a dynamic rigidbody you need to apply a force on the rigidbody. You can find more information on the pages below.

Kinematic rigidbody:
https://developer.playcanvas.com/en/tutorials/manipulating-entities/

Dynamic rigidbody:
https://developer.playcanvas.com/en/user-manual/physics/forces-and-impulses/