Search Unity

Creating Voxel Mountain From C# Code and Explosion of This Mountain

Discussion in 'Getting Started' started by OnurGungor, Mar 18, 2017.

  1. OnurGungor

    OnurGungor

    Joined:
    Mar 18, 2017
    Posts:
    4
    Hi Guys,

    I am trying to create a mountain from voxel, in next step, some specific part of this mountain will explode. It should be all specified from c# code. I made a pyramid voxel right now but all mountain is exploding when I press the Q button. Does anyone know how can I control cubes which is created after press run button, inside of the voxel pyramid, ? Or does anyone have different idea to do this? I shared cubes which ı tried to talk about.

    Thanks for your help...
     

    Attached Files:

  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    You're gonna have to share a lot more than that if you want any kind of useful input. How are you making the explosion currently? Share some code and describe how things interact.
     
  3. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,144
    There are two basic ways:
    1. attach a script to each cube that handles its movement
    2. attach a script to the cube container object that handles movement for every cube
     
    Last edited: Mar 19, 2017
  4. OnurGungor

    OnurGungor

    Joined:
    Mar 18, 2017
    Posts:
    4
    Hi again, I am using VoxelTool for creating cube. When I press Q, as you see Update runs MakesAllCubesFall(). I have no idea how can I select specific cubes.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      174.8 KB
      Views:
      866
  5. OnurGungor

    OnurGungor

    Joined:
    Mar 18, 2017
    Posts:
    4
    Hi Ryiah,

    Thanks for your reply,

    Can you give me some example about these ways, I couldnt find how am I gonna do that...