Having trouble with the scene.add(Obj);
line for my object player1. I keep getting an error saying that Obj
does not exist:
function Player(x, y, z) {
this.Speed = 0;
this.AngleAcc = 0;
this.Angle = 0;
this.X=x;
this.Y=y;
this.Z=z;
this.MaxSpeed = 100;
var PlayerMateririal = new THREE.MeshLambertMaterial({ color: 0x00ff80, overdraw: 0.5 });
this.Obj = new THREE.Mesh(new THREE.BoxGeometry(50, 90, 60), PlayerMateririal);
scene.add(Obj);
Obj.position.set(x, y, z);
}
Trying to set the Obj
position in different locations using Three.js and it's set up as a property. Would appreciate any help. Thanks!