I want to load a animation file from server in my script follow.js.
Follow.prototype.initialize = function() {
this.app.assets.loadFromUrl("https://www.example.com/animacoes/animation.json", "animation", function (err, asset) {
entity.addComponent("animation", {
assets: [ asset ],
speed: 1
});
console.log(asset);
this.entity.animation.play(asset, 1.0);
});
};
But its error appear:
ReferenceError: entity is not defined
Can someone help me?
Best regards