Metaverse Draw Lots-Using Variable and Lists of MR Project
This tutorial includes logic of "Transform, Actions, Controls, Events, Events and List".We will learn about:
Keep from simultaneous click,
Come up draw lots after setting visibility to false
Randomly come up lot after clicking the box
- Open PowerPoint, edit image and export it.
- file>save it to jpg
- open Blender>import FBX>shift to Shading>change the image
Object's basic setting
- Drag 3 model to the scene.
Add text of "correct " and "wrong".
- Drag box to the scene, and put "lottery02、lottery02(1)、lottery02(2)" to lottery01.
- Put lots to the box and adjust the angle in needs.
- Close the objects besides 3 models.
- Add all of object logic.
- Open the logic.
- Set the object's visibility to true.
- Add variable>keep from simultaneous click and set the visibility to false.
- Add "If…do" logic.
(2). Set object's visibility to true.
Note: add text of "wrong".
(3). Add variable "keep from simultaneous click=false".
Note: you can not click the objects before step4.
(4). Wait for 1 second.
(5). Set object's visibility to false.
Note: close the text of "wrong".
(6). Set "keep from simultaneous click=false".
Note: close the situation that can not click objects.
(7). Copy 2 and adjust the other object's trigger situation.
- Take the model of giraffe for example.
- Copy three model and set their visibility to false.
- Set lottery01 visibility to true.
- Add variables>start to draw lots >true.
Draw Lots Setting
- Add "When…is clicked" >set the up moving animation.
- Add "If…do">set variable of start to draw lots to true. You can repeatedly click.
- Set click for once, add variable to false and put it on the animation's top.
- Add variable : lot result.
- Set lot result: operators>random number from …to…
- Set random number from 0 to 5.
- Set random number from 0 to 5 (01234) in logic.
- EX1: set 0~5, it will be 01234.
- EX2: set1~6, it will be 12345.
- EX3: set6~9, it will be 678.
- When setting lot’s visibility, you could know that the coming up of animation and lot is too close, so add wait for 1 sec.
- Add "create empty list" and add "MyList" to variable.
- Add data>lists> add transform item to MyList.
- Copy 3 and put them behind create empty list.
- Data>list>set set "add my list to lot result" visibility to true.
- Repeatedly click setting
- Event>when…is clicked.
- Set Lottery (1) visibility to false.
- Copy animation and change it to moving down.
- Set "start to draw lots" to true.
- Finish and start to experience!