I’m working with a fork of the TPS Demo. I changed the original player model to mine, added my animations, and changed the names of the animation files in the playerAnimationHandler.js script. That is ALL I did to the scene. It all works fine, except now I’m getting this error “camera.script is undefined” when I run the project. This breaks the project as the player movement doesn’t work (any movement you currently see is built into the animations, which I’ll have to figure out how to get rid of later). I believe this is coming from the playerMovement.js script, right in the initialize function:
PlayerMovement.prototype.initialize = function () {
var app = this.app;
var camera = app.root.findByName('Camera');
this.cameraScript = camera.script.cameraMovement; //this is where the error is coming from as far as I can tell
};
It might just be that my brain isn’t working properly, but I can’t seem to find any reason why this error should be happening as the ONLY change I made to the code was changing the names of the animation files. As stated before, the player entity is the same too, besides the different model and animation files.
Here’s the link to my project (Look in the Main2 scene, and ignore the Network.js and socket.js scripts. Those aren’t currently implemented.): https://playcanvas.com/editor/scene/975168
Thanks in advanced!