TypeError: this.app.mouse.isPointerLocked is not a function

I am trying to use the “isPointerLocked()” function, and it is giving me this error.

Here is the full script:

var Rotate = pc.createScript('rotate');

Rotate.attributes.add('rotateSpeed', {type: 'number'})

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

    this.app.mouse.on("mousemove", this._onMouseMove, this);

    this.app.mouse.on("mousedown", this._onMouseDown, this);

    this.eulers = new pc.Vec3();

};

Rotate.prototype._onMouseMove = function (e) 
{
    
    this.eulers.x -= e.dx
    this.eulers.y -= e.dy

}

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

    console.log(this.app.mouse.isPointerLocked)

    if (this.app.mouse.isPointerLocked())
    {
        
        this.entity.setLocalEulerAngles(this.eulers.y * this.rotateSpeed, this.eulers.x * this.rotateSpeed, 0);

    }


};

Rotate.prototype._onMouseDown = function (e) 
{

    this.app.mouse.enablePointerLock()


}

I’m pretty new to PlayCanvas so I feel like I might be making a pretty newbie mistake lol.

it seems to be a static function and you probably want to call it like this:

This worked. Thanks!