hi
I am trying to use the loadScene on my project to jumpscare the player by changing to a jumpscare scene, What I want to do is, when the player touches the collision box I want to load the jumpscare scene
this is my code
var JumpScare = pc.createScript('jumpScare');
// initialize code called once per entity
JumpScare.prototype.initialize = function() {
this.entity.collision.on('triggerenter', this.onTriggerEnter, this)
};
JumpScare.attributes.add("sceneName", { type: "string", default: "", title: "Scene Name to Load" });
JumpScare.prototype.onTriggerEnter = function(entity) {
loadScene(this.sceneName, { hierarchy: true, settings: false }, function (err, parentEntity) {
if (err) {
console.warn(err);
} else {
console.log('Scene \'' + this.sceneName + '\' Loaded');
}
}, this);
}
but when ever I try to run it, the console says “loadScene is not defined”