Hey everyone, I’m Beth, I’m an XR developer based in Kansas City, Missouri, and I’m thrilled to share my interview today as part of the Scripting AR video series. For this episode, we’re talking about situations where using scripts might help you build faster and work more efficiently than you might otherwise be able to do using the Patch Editor alone.
To help make this point, I’m sharing three different AR projects today, including Spikey, Gem Smash World, and Countdown to Vote, to help show you how scripting helped me shortcut the build time and add more interactive elements, faster. Watch the full episode now, and see my three tips after to help you get started with scripting your own AR projects.
I hope you find this first episode of Scripting AR helpful. Our goal with this series is to make scripting less intimidating and more approachable for all types of Meta Spark creators. Over the next few weeks, we’ll be sharing more information from each interview right here on the Meta Spark blog, including the full-length episodes, so please make sure to keep an eye out for those additional posts coming soon.
See documentation and tutorials to learn more about scriptingRead more
Download a sample template and start scripting your own effect todayGet template
Additionally, I wanted to highlight just a few of the tips shared in this discussion that I thought were important, especially for those of you who may be new to scripting in Meta Spark Studio.
In the case of scripting for the Spikey effect we discussed in today’s video, I was looking at binding the physics rotation to somewhere around 200 bones. Imagine having to create multiple patches for each of those bones!? That doesn’t sound like a very fun process, especially if adjustments need to be made. Scripting makes working with repetitive tasks so much easier, not only with the ability to copy and paste, but also you can highlight and select multiple instances of the same code and edit it all at once. Follow Viv Galinari’s tutorial for an even more efficient way of scripting physics with a loop function.Spikey AR effect by Beth WickersonExample of patches vs scriptThis script supports an unlimited amount of bones!
Learning to script by following a tutorial is a great way to start, and you might get even more learning out of it by making adjustments to add a feature. GitHub is a great resource where programmers keep repositories of code that anyone can access. In some cases, the code is open-sourced, giving you the ability to make adjustments and send it back to the developers for review and possibly publishing your work. I definitely recommend the Spark AR Community GitHub, the SparkAR-Snippets repo is full of useful resources and they welcome contributions! That is also where you can find Josh Beckwith’s famous particle fade script with very helpful instructional comments.
For the Gem Smash effect demonstrated in today’s video, I again used Viv’s scripting tutorials, this time for patch bridging and adding the Persistence Module for scorekeeping. In my case, I wanted to show the user’s high score at the beginning of the game, so I made a few adjustments to that script to suit my needs. If you would like to check that out you can access it on my GitHub repo, as it also includes an update for the Persistence Module that will affect Meta Spark v157 and above. As with using any API, sometimes updates need to be made to your code as the API is updated. Following the API reference documentation is useful when determining how to fix any errors you may encounter.Gem Smash AR effect by Beth Wickerson
You can find the full project file for the countdown and persistence module on my GitHub repo. Check it out, and if you make something tag me to let me know, I would love to see it!
I hope you find this information helpful. If you’re interested in learning more about scripting, I recommend watching the first episode of Scripting AR which gives a great overview of the scripting capabilities in Meta Spark Studio, as well as how to use the library of documentation and tutorials available.
You can learn more about me and my work @bethwickerson and @signaltheory’s work to combine behavioral science and technology to build stronger human connections. And if you haven’t already, I invite you to join the Meta Spark Community where me and many, many other talented creators and developers regularly talk about our AR projects!
Subscribe to the Meta Spark Blog