Search Unity

Resolved Why spawn object is not working? (bolt)

Discussion in 'Visual Scripting' started by Dudusstar, Dec 7, 2020.

  1. Dudusstar

    Dudusstar

    Joined:
    Nov 19, 2020
    Posts:
    59
    Hi! This is Edu from Barcelona. Sorry because I've just started learning visual scripting with bolt and I can't find a solution for this.

    I wan to spawn a prefab object called bush several times in random spots with bolt (see attached image). And I get it done but for some reason I can`t see that cloned bushes on screen. I create an empty object with an embed flow graph with the reference to the bush.

    See attached pictures. Maybe it's because the object position has the axis different as the main scene?

    Does anybody have a clue about the reason?

    Thank you so much for your time and patience!
     

    Attached Files:

  2. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Try leaving Z axis at 0, as it controls depth in 2D space and you shouldn't need it in most cases. Use sprite sorting order and sorting layers to control draw order instead. You'd want to randomize only X (left/right) and Y (up/down) axis in 2D.
     
    Dudusstar likes this.
  3. Dudusstar

    Dudusstar

    Joined:
    Nov 19, 2020
    Posts:
    59
    Purrfect, I'll try this!
     
  4. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Since objects are correctly spawned in the scene, you can double click an object in Hierarchy window to zoom in on it. And then you can play around with its Inspector settings in Play mode until it becomes visible.
     
    Dudusstar likes this.
  5. Dudusstar

    Dudusstar

    Joined:
    Nov 19, 2020
    Posts:
    59
    Done! I've just played with the axis position, It turns out that needed to be rotated 90 degrees. What a mess set up!!! Thank you for your help. I really appreciate it.