[SOLVED] Error: Cannot read property '0' of undefined

Hello, I have just started playcanvas and attached a input script to a ship asset. The console reading is giving me and error for playcanvas-stable.js:1187, and the error states: Uncaught TypeError: Cannot read property ‘0’ of undefined.

If I remove my input script it launches fine. But the input script is not giving me any errors that I can see,
https://playcanvas.com/editor/code/375634/input.js
Would someone be willing to skim over it and help me out? Thanks

The problem is this line:

pos.add(x, 0, z);

The pc.Vec3 add function does not take three numbers. It takes a single pc.Vec3. See the API reference entry for that function for more details.

Thanks! I’m not getting the error anymore. And thank you for for linking me to the API reference