Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created June 28, 2020 06:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/a6f54028929816322b35886b393c288a to your computer and use it in GitHub Desktop.
Save flushpot1125/a6f54028929816322b35886b393c288a to your computer and use it in GitHub Desktop.
var x,y,z:number;
if(snakeStep ==Direction.UP){
x=y=0, z=1;
}else if (snakeStep==Direction.DOWN){
x=y=0, z=-1;
}else if (snakeStep==Direction.RIGHT){
x=1,y=z=0;
}else if (snakeStep=Direction.LEFT){
x=-1,y,z=0;
}
snake.translate( new Vector3(x,y,z),6,Space.WORLD);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment