Instantiating Scene Objects
Hey everyone. Coming from Unity, I'm having to learn some new vocabulary as well as brush up on my Javascript. I'm sure the answer to this is simple, but looking through the API, I'm having a tricky time figuring out how to instantiate a new scene object via script.
The simple use case would be to, on a tap event, instantiate a scene object with a box mesh visual component.
I can see how to create a component here: https://lensstudio.snapchat.com/api/classes/SceneObject/
But I can't see how to instantiate a new object to attach that component to!
Thanks for your help!
Hi Austin!
Use Scene to create new object and then call setParent.
See https://lensstudio.snapchat.com/api/classes/ScriptScene/ method createSceneObject