WebXR AR/VR Golf Flick
Play a one-hole mini-golf challenge by flicking a physics-based ball toward the hole in AR, VR, or a desktop browser view.
What this tool does
This A-Frame game places a white golf ball on a green plane and uses the Ammo physics driver to simulate each shot. Drag or flick across the scene to apply direction and force; the game counts strokes and reports when the ball reaches the hole.
Who this is for
- Players looking for a quick one-hole browser game
- Students exploring touch gestures and browser physics
- Developers testing AR/VR golf interaction patterns
- Teams demonstrating a simple WebXR game loop
How to use this tool
- Open the page in a modern browser, then choose Enter AR or Enter VR when supported
- Aim the camera or desktop view toward the green and hole
- Press and drag across the scene in the direction you want the ball to travel
- Release to flick the ball; longer or faster gestures apply more force
- Watch the Strokes counter and continue until the ball enters the hole
- After the ball is sunk, flick again to reset it for another attempt
Inputs
- Mouse drag — Start and end a flick on desktop
- Touch gesture — Drag and release on a phone or tablet
- AR/VR camera view — Optional immersive view with local-floor and hit-test WebXR features
- Flick magnitude and direction — Determines the horizontal impulse applied to the ball
Outputs
- Stroke count — Updated after each valid physics shot
- Game status — Confirms when the ball is in the hole and shows the stroke total
- Physics result — The ball rolls across the green and responds to collision and friction settings
Example use cases
- Gesture prototype — Test how a drag becomes a directional force in a 3D scene
- AR demo — Show a small interactive experience using camera-based WebXR
- Touch game lesson — Explain input handling, physics, collision triggers, and score state
Frequently asked questions
How is a stroke made?
Press and drag on the scene, then release. The game converts the gesture's direction and magnitude into a horizontal physics impulse and increments the stroke count.
Can I play without an AR or VR headset?
Yes. The scene can be viewed in a regular desktop or mobile browser with mouse or touch input. AR and VR are optional WebXR modes.
What happens when the ball reaches the hole?
The game stops the ball, displays the number of strokes, and lets you flick again to reset the ball for a new attempt.
Need a custom AR or browser game?
SolvProb builds tailored WebXR demos, interactive 3D tools, and browser games around your concept.
Talk to SolvProb →