I am trying to move pipes depending on what random number is generated:
app.on('pipe:relocate', function () {
var rnd = Math.random();
var item = this.app.root.findByName('Pipes');
this.far = [];
if (rnd > 0 < 0.33) {
var pos2;
pos2 = this.item.getLocalPosition();
this.item.setLocalPosition(1, pos.y, pos.z);
}
if (rnd > 0.33 < 0.66) {
var pos3;
pos3 = this.item.getLocalPosition();
this.item.setLocalPosition(2, pos.y, pos.z);
}
if (rnd > 0.66 < 1) {
var pos4;
pos4 = this.item.getLocalPosition();
this.item.setLocalPosition(3, pos.y, pos.z);
}
}, this);
app.fire('pipe:relocate');
There error is in the first line, but I don’t know how to fix this? I have tried to inspect and debug but I have not found a solution,
Thanks