Hello everyone, i made a new script for the change button but when i click on it it says there is an error.
This is the code:
var Changebutton = pc.createScript('changebutton');
Changebutton.attributes.add('sceneName', {type: 'string'});
// initialize code called once per entity
Changebutton.prototype.initialize = function() {
this.entity.button.once('click', function() {
loadScene(this.sceneName, { hierarchy: true, settings: true });
}, this);
};
This the error message