Can't assign to property "jumpHeight" on true: not an objecterrorInfo.stack?

I decided to test the standard physics and collision in the engine. I used an example:

start () {
        this.rigidbody = this.node.getComponent(RigidBody2D);

        this.collider = this.node.getComponent(BoxCollider2D);
        if( this.collider ) {
            this.collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
        }
    }
    onBeginContact( selfCollider: BoxCollider2D, otherCollider: BoxCollider2D, contact: IPhysics2DContact | null ) {
        
        if( otherCollider.name == "star<BoxCollider2D>" ){
            otherCollider.node.getComponent("Star").destroyStar();
            this.score++;
            this.scoreLabel.string = "Score: " + this.score;
        }

    }

Here’s my code:

    start() {
        this.rigidbody = this.node.getComponent(RigidBody2D);
        this.collider = this.node.getComponent(Collider2D);
        if (this.collider) {
            this.collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, true);
        }
        this.node.getComponent(Animation).play("idle");
    }
    onBeginContact(selfCollider: BoxCollider2D, otherCollider: BoxCollider2D, contact: IPhysics2DContact | null) {
        if (otherCollider.name == "Floor<BoxCollider2D>") {
            this.jumpHeight = 0;
        }
    }

My code gives this error:
can't assign to property "jumpHeight" on true: not an objecterrorInfo.stack ?
How can I correct this error?

hi,bro!
pay attention to the last parameter of collider.on.
it is the thisArg of the callback function.
in your code context, it should be this.

Thank you for your reply.

Sorry, I forgot to answer this question. I was able to solve the problem. I took the variable outside of the class, that helped.