Navigation

    CreatiCode Scratch

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Run code when the 3D scene is ready

    3D Blocks
    1
    1
    20
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by info-creaticode

      For every 3D project, before we can run any 3D block, we have to initialize the 3D scene.

      For example, if we try to run these blocks to add a box at the beginning of the program, the box will not be added successfully, because when the “add box” block runs, the scene has not been completely initialized.

      858ce899-8302-4a88-90b1-96022ad00bd9-image.png

       

      To run any code after the 3D scene has completed initialization, you can attach them to this block:

      73dafdb6-d9a7-4f72-8548-d0a9b5d5b3aa-image.png

       
      For example, this is the revised program that adds a box right after the scene has been initialized:

      e20774de-55ca-4e18-b9c6-9681d26f733a-image.png

       
      Note that you can also use this block in other sprites, and it will always wait until the 3D scene is ready.

      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post