How to teleport a camera when a button was clicked?

I’m doing this for a school project, hence, I’m a beginner. I want to teleport my camera when a specific button was clicked. Currently, this is my code however, when I launched it, my camera is already in the position that I specified. The camera must only teleport if a button was clicked. What should I modify to make this work?

var LevelComplete = pc.createScript('levelComplete');

LevelComplete.attributes.add('cameraEntity', {type: 'entity'});
LevelComplete.attributes.add('nextEntity', {type: 'entity'});

// initialize code called once per entity
LevelComplete.prototype.initialize = function() {
    
};

// update code called every frame
LevelComplete.prototype.update = function(dt) {
    LevelComplete.instance = this;
    
    this.nextEntity.button.on('click', this.cameraEntity.rigidbody.teleport(166, 12, 30), this);
};

Hi @help and welcome!

Line 15 of the code above should be placed in the initialize function instead of the update function.