Meta Spark

Boost Your Creativity With Scripting

Learn how to add creative elements to your AR effects using JavaScript

By: Tomas Pietravallo
June 6, 2023
Meta Spark

Boost Your Creativity With Scripting

Learn how to add creative elements to your AR effects using JavaScript

By: Viv Galinari
June 6, 2023

Scripting AR is a new video series where we invite Meta Spark experts from all over the world to demonstrate and discuss how they’re using JavaScript in their AR projects. As part of this series, we’ve asked each expert to contribute a short post highlighting just a few of the tips shared during their interview. Be sure to watch the full-length video below to learn more. Today’s contributor is Tomás Pietravallo (@tomaspietravello)

Hey everyone, I’m Tomás, I’m an AR developer based in Argentina, and I’m excited to debut my interview as part of the Scripting AR video series. For this episode, we’re focusing our conversation on how to add creativity to your effects using simple scripts, and I am demonstrating three different projects, including Wiggly Eyes, Cherry, and Víboritas, to help show you exactly how scripting helped me add creative elements to each one. Watch the full episode now, and see my three tips after to help you get started with scripting your own AR projects.


Adding Creative to Effects with Simple Scripts

with Tomas Pietravallo

Something Went Wrong
We're having trouble playing this video.

Take the next step

Explore what’s possible with scripting in Meta Spark Studio


See documentation and tutorials to learn more about scripting

Read more


Download a sample template and start scripting your own effect today

Get template

I know we covered a lot of topics in this video interview, but 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.


Enhance your existing abilities with code

You can use scripts to improve your efficiency and leverage it as a new tool to create more complex and novel experiences. This doesn’t mean you have to walk away from what you’ve already learned using Meta Spark, in fact it’s the opposite — consider coding as a way to continue building your skills and experience, so you can apply it to your next project!

Boost Your Creativity With Scripting
Screenshot from a project where I started an exploration of 3D modeling, and then I was able to enhance it using scripts. Way too many bones to animate conventionally!


Start off small, and learn by example

By focusing on smaller tasks in your project, you can work to problem solve and learn in the process — even if that means skipping some of the shortcuts and taking a little more time. So let’s say you want a UI Slider in your effect. Maybe instead of using patches, you attempt to code it? True story, I did exactly this a while back on a project, and that was my first timing scripting!

Boost Your Creativity With Scripting
Example of a small snippet of JavaScript showing how to import the Native UI slider into a script, next to the patch asset equivalent.


Don't be afraid

The first thing that I encountered when I started to code, was a console error, and you know what, so does everybody else! The console is simply a tool to let you know what is broken and needs to be fixed, but that in no way means you should stop. If you get stuck, you can always check the documentation and learning materials, or just jump into the Meta Spark Community and ask your questions.

Boost Your Creativity With Scripting
Screenshot of what a console error looks like in Meta Spark Studio.

I hope you find the interview and these tips helpful. If you’re interested in learning more about scripting, I highly recommend watching the first episode of Scripting AR where Viv Galinari provides 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 at, and if you haven’t already, I encourage you to join the Meta Spark Community where me and many other talented creators and developers regularly talk about our AR projects!

Subscribe to the Meta Spark Blog