Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created December 15, 2022 14:24
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/bb8619d4615f258b456d0646143349ff to your computer and use it in GitHub Desktop.
Save flushpot1125/bb8619d4615f258b456d0646143349ff to your computer and use it in GitHub Desktop.
scene.registerAfterRender(function() {
// if(sphere.intersectsMesh(hitbox))
F = engine.getFps();
if((map["a"] || map["A"])){
sphere.translate(BABYLON.Axis.X, -distance, BABYLON.Space.WORLD);
}
if((map["d"] || map["D"])){
sphere.translate(BABYLON.Axis.X, distance, BABYLON.Space.WORLD);
}
if((map["w"] || map["W"])){
sphere.translate(BABYLON.Axis.Z, distance, BABYLON.Space.WORLD);
}
if((map["s"] || map["S"])){
sphere.translate(BABYLON.Axis.Z, -distance, BABYLON.Space.WORLD);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment