Babylon JS Day 18

I didn’t have much time to work on Babylon JS today, but I did have an idea for what I want to build for the project on Friday. Since receiving the Oculus Quest 2 last fall I’ve been playing Pro Putt quite a bit with friends. Sometimes we talk about different game mechanics that we would build if we were making a golf game. I’m not going to try to build a full golf game, at least not any time soon. Instead, I’m going to see if I can get a usable demo done this week. I’ll layout what I hope build here.

  • Make or import a simple golf club mesh. Attach it to the as a child object to the controller so that it moves when the VR controller moves. Hide the Oculus controller model.
  • Make a simple ball. Easy. Place a ball at a fixed location in a scene. Bonus: press a button on the controller to respawn the ball after I hit it.
  • Learn how to use physics in Babylon JS. Tap the ball with the end of the club to make the ball move. This will take some iteration to find something that feels natural.
  • Make some sort of target. A hole and flag to aim for or just a large collider.
  • If there is any time after finishing the items above, I’ll try to make a few interesting golf holes with some terrain.

I got started today by learning how to attach a mesh to the VR controllers. This playground has an example of placing small box meshes to the inside of the VR controllers. I think I can modify this to attach a club mesh. I’ll tackle that problem tomorrow.