Scene gets reloaded for the first time. Issue occurs from second time onwards.
Movement.prototype.reloadScene = function() {
// Get a reference to the scene's root object
var oldHierarchy = this.app.root.findByName('Root');
if(oldHierarchy)
oldHierarchy.destroy();
// Get the path to the scene
var scene = this.app.scenes.find(this.sceneName);
// Remove mouse and touch events
if (this.app.mouse) this.app.mouse.off();
if (this.app.touch) this.app.touch.off();
// Load the scenes entity hierarchy
this.app.scenes.loadSceneHierarchy(scene.url, function (err, parent) {
if (!err) {
console.log('Loaded');
} else {
console.error(err);
}
});
};