Created
July 25, 2020 10:57
-
-
Save Core-commits/020b84b61ecc8c45ab931c05390f4fe1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function moveBrick(name, interval, increment, x, y, z) { | |
world.bricks.find(brick => brick.name === name) | |
brickX = brick.position.x | |
brickY = brick.position.y | |
brickZ = brick.position.z | |
setInterval(function () { | |
for (brickX <= x; brickX+increment;) { | |
console.log(brick.position) | |
} | |
for (brickY <= y; brickY+increment;) { | |
console.log(brick.position) | |
} | |
for (brickZ <= z; brickZ+increment;) { | |
console.log(brick.position) | |
} | |
}, interval); | |
} | |
// How to use. | |
moveBrick("MyBrickName!", 0.01, 1, 100, 20, 0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment