Why is the THREE.Mesh() object showing as undefined even though it was defined in a THREE.JSONLoader()? Here is the code snippet...
1: var player;
2: var playerCallback = function(geo, mats){
3: player = new THREE.Mesh(geo, new THREE.MeshFaceMaterial(mats));
4: console.log("Loaded Model: " + 'resources/models/Player.js');
5: }
6: JSONLoader.load('resources/models/Player.js', playerCallback);
7: player.position.set(0, 20, 20);
8: player.physics = false;
9: scene.add(player);
The issue arises at line "7" where player is reported as undefined. However, just before that, "Loaded Model: resources/models/Player.js" is displayed correctly.