A lot of our favorite VR experiences are short and capitalize on a fun central mechanic. We wanted to make an AR game that could capitalize on the "room mesh" generated by spacial computing platforms in the AR space to make fun interactions. "Line Rider" came to mind as a browser game in which manipulating space generated a fun, user-led interaction. The user would be able to spread snow over the scanned surfaces to create slopes for the character to sled down. The interaction could be extended to create conversations about climate change by having the "pickups" that the user tries to steer the character into as plastic recyclables and other items/actions associated with positive environmental impact (eg. planting trees).
What it does
You can use the Magic Leap controller to teleport a character on a sled in front of you; the character will sled down the slopes generated by the mesh
How I built
The character is physically simulated using a ball collider and rigidbody in Unity, and the sled and character are rotated using spherical linear interpolation to match the rotation fitting the normal vector to the ground they are sledding on and the velocity vector of the rigid body. The collider has a physics material with very low friction. We created a shader for the Lightweight/Universal Render Pipeline, but had to scrap it and restart it after learning that there is not currently support for the pipeline - unfortunately this set us back from accomplishing the narrative we aimed for. The result is a fun AR toy, with which users can try to extend the path of the sled by creating stacks and slopes out of real-life objects.
Challenges I ran into
Programming the snowfall shader and then attempting to reprogramthe snowfall shader outside of Shadergraph proved difficult for our team. We also may have benefited from more help from the Magic Leap team early on, as a misconception about the development pipeline prevented us from moving forward with the project for a lot of the hackathon. In the future we would like to leverage the availability of mentors more in learning skills from such projects.
Accomplishments that I'm proud of
The character's movement is fun to interact with, as the spherical collider makes it easy to predict its movement and its tendency to rotate towards the direction of movement gives the character more personality than a rolling ball.
What I learned
We learned about creating vertex shaders, as well as some other types of shaders, and about the Magic Leap API and implementation.
What's next for SledAR
Finishing the snow piling mechanic is the main priority; then we would like to generate starting points and end points based on the room's collision mesh, as well as obstacles and pick-ups. These features could help create more of a narrative throughout gameplay rather than the more repetitive simple interactions we've achieved.