28 Mar 2023, 22:48

Introduction

When there are many objects in a 3D scene, you can iterate through all of them using the following block:

ace349ad-1982-4da7-b3cc-db38788da9f8-image.png

 
This block will go through all 3D objects created in the current sprite one by one. The variable dropdown allows you to specify a variable, so that the name of each object is stored in this variable one by one.

You can use this variable to select that object inside this loop, and then add other blocks to manipulate that object.

 
 

Example Program

 
This program will create 3 boxes and move them one by one repeatedly. Note that to move a box, we need to select it as the “sprite object” first, and the “object name” variable tells us the name of each box.

 

53d80d5c-b1df-4e8c-b203-97b1acb1c949-image.png

 
This is the result:

obj.gif

 
You can try the program here:

https://play.creaticode.com/projects/3b5253351ee5292751648924