How do I achieve this quiz effect?
Hi Everyone!
I'm currently working on a trivia quiz lens.
I'd like it to work exactly like this one:
https://lens.snapchat.com/aff77f7bcc5f4b80a27890543955bbef
How it works?
• Question on top of head
• Two answers (one on the left and one on the right)
• User tilts head left or right to select answer
What I managed to complete
• All graphics and questions are ready
• I have used the 'head tilt' asset/script to allow user to select answer
E.g.
Head tilt script + behaviour script:
on custom trigger
ON_LEFT - set colour of correct answer to green
ON_RIGHT - set colour of wrong answer to red
What I'm struggling with?
I've managed to achieve everything except going to the next question.
Once first question answered with head tilt, show next question.
I tried using the behaviour script to disable and enable questions once the previous is answered, however it seems like questions are still being affected by ON_LEFT & ON_RIGHT even while disabled and are being answered before the user even sees the question.
One more idea I had is to create a counter and do something like
On trigger ON_LEFT & ON_RIGHT, increase counter by 1
then:
If counter = 1, hide question 1
if counter = 2, hide question 2
and so on...
but I'm not sure how to exactly integrate this with the 'head tilt' in Javascript, or if it'll even work.
Any ideas on how I can do this? Thanks in advance everyone!
Best Answer
-
Hey everyone,
I did manage to create this project successfully some time ago.
Since there's a few interested, I decided to share the project so you can use it as a template.You can find the template and instructions here:
https://community.snap.com/snapar/discussion/2105/template-tilt-head-to-answer-quiz-questions-lens#latestHope it helps!
@brandon @Monkey XR @Laurent 🤘 @Stefan Edelmann @Ziyaa Boghani
1
Answers
-
I'm actually the developer of that wikipedia game lens, made for a client lol. Cool to see it mentioned
I have a custom implementation but looks like it's still doable with your setup. The big difference I see is that I don't actually change the question until the head is centered by the user. I found user's kinda naturally recenter their head after answering so it isn't an issue.
In the tilt head script you are using, the "on reset" function is called when the head returns to the center. So you could probably have one of those setup for each question and call the question change when that is fired.
Let me know if this fix doesn't work, then I can look for another method.
4 -
Your lens is cool @brandon (as usual ) !
@Monkey XR did you find a template ? I’m trying to work on a template for my student but unit now … 😬2 -
@Monkey XR @brandon @Laurent 🤘 same here, so hard to do this project without template, can i ask the dummy project ?
0 -
Hello @brandon ,
Hello @Aleks Brzoska ,
I am currently writing my bachelor thesis and need the quiz, do you have a template for me?1 -
Hello @Laurent 🤘 ,
Hello @Monkey XR ,
did you find a template? I need it for my bachelorthesis0 -
Is there a tutorial for this? @brandon
0 -
Hello everyone, a newbie aboard, did anybody get the tutorial? I am a student at the college of mathematics and physics and need to create a quiz based on a research paper of a famous researcher.
0 -
Thanks for closing the loop @Aleks Brzoska !!!
@rosefromtitani @Ziyaa Boghani I would see the "best answer" post right under the original post
0 -
Oh, yeah, thanks!*
0