Enable random object from array on tap
Hi,
I'm creating a lens for my graduation which will show someone's 'digital aura'. The idea is that someone can analyse all their online communication and come up with personality traits of their digital persona.
Those personality traits will then be visualised into different forms, colors or shapes of the aura.
For my prototype I would love to be able to fake this. But to make the effect a little more realistic, I want the user to open the lens, tap through the introduction and then get a random aura assigned to their face. The "random" aura would just be one picked out of an array consisting of 10 different sprites. Or one sprite which will select a random texture out of 10.
I found this which looks promising, but I'm not sure how to adapt the script to work with sprites, instead of audio. Preferably I would have the functionality built in the FullscreenTemplate, so that I'll still be able to show an introduction first.
Any help would be greatly appreciated! And I'm not graduating in Javascript, so I'm not letting you do all my work :)
You could do something like this:
Thanks a lot Apoc, you absolute hero! You have no idea how much that helps.
How did you create an array of sprites? I need the same help. How can I link the script with the array. All my sprites are displayed at one, how can i hide them and how can the script be linked. Thank You
Click on the Camera object > Click on Add Component in the Inspector panel > Script. That's where you add the script. You'll then have a new option to add the Sprites. This is what that looks like:
Thank You :) It was amazing! You rock! Also Is it possible to add a keyboard where a person can enter the name, and it displays as a sprite! Thanks Again !
No problem, @apoc did all the work! There have been creators that managed to implement a keyboard, but that will take a lot of custom coding. You might want to dive into the scirpting part some more, before you'll be able to code something like that.
I'm not a part of the Lens Studio Dev team so I can't help you with that without charging you for it.