Question Randomizer Effect - Random Unique Number Generator Script
$0+
$0+
https://schema.org/InStock
usd
Jeetesh Singh
This is a script for Spark AR. This script can be used for randomizer effects that require a unique random number (int, question number) to be generated every time a pulse is sent through.
- How To Use:
- Import the script, and add 'To Script' and 'From Script' variables as shown in the images.
- Add To Script Patches for user inputs in the patch editor.
- Drag and drop the script from the Assets panel into the patch editor for output.
- This patch is mostly useful if you include all of your questions as an animation sequence in your project, where each frame has one question.
- (Optional) Use the if-else block(as shown in the images) if your first frame is not a question and is just an introductory frame (as shown in the images).
- (Optional) Make a group of the inputs and output to keep it manageable (as shown in the images).
- Script Inputs:
- Count - The highest frame in your animation sequence. i.e. The number of questions included. This value is used by the script to prepare you a pool of numbers to pick from.
- Randomize - The trigger input which as received returns a random number that is generated and outputs it from the 'Variables from Script' output.
- Script output:
- RandomNumber - This is the integer that is generated from the pool of numbers. This number is unique so we can generate a new question from the set every time, it is non-repeated until the number is generated more times than the number of questions.
It's been a while since I had made this script so if there are any questions or if you get stuck somewhere with this just connect to me and let me know if I can help.
You'll get a SparkAR Script that can be setup with your patch editor to generate unique random number from 0 to Limit.
Size
2.15 KB
Add to wishlist
30-day money back guarantee
Ratings
2
5
5 stars
100%
4 stars
0%
3 stars
0%
2 stars
0%
1 star
0%