I had a problem with my game, can you give me hints, advice, or anything
I had a problem screenshot the game error so here is the error
[move.js?id=8837089:12]: Uncaught SyntaxError: Unexpected token }
SyntaxError: Unexpected token }
var Move = pc.createScript('move');
// initialize code called once per entity
Move.prototype.initialize = function() {
};
// update code called every frame
Move.prototype.update = function(dt) {
this.entity.translateLocal(0.01, -0.9, 0.10);
}
};
return Move;
));
As it is a SyntaxError, that means there is something wrong with the code itself rather than the logic. The error message âUnexpected token }â means there is an extra } somewhere in the code. The error message also tells you which line it thinks that the error is on.
Looks like youâre upgrading a script from the previous scripting system? You have some additional unnecessary code at the end. Your code should be:
var Move = pc.createScript('move');
// initialize code called once per entity
Move.prototype.initialize = function() {
};
// update code called every frame
Move.prototype.update = function(dt) {
this.entity.translateLocal(0.01, -0.9, 0.10);
};