Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

spawned prefabs different heights

Discussion in 'Scripting' started by D-007, Dec 15, 2021.

  1. D-007

    D-007

    Joined:
    Sep 14, 2021
    Posts:
    70
    I have a scene which has spawn points, and at each of these spawn points different objects can be spawned. However, because they are different objects, some are spawning in the ground and some above. I want them all to spawn touching the ground. Without having to edit all the objects in blender etc, is there a way I could make each object spawn at the correct height. I have tried adding them to an empty, but that doesnt work i think because of the spawn points, they are empties too so have their own location.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,001
    Are you sure you did it properly? That is almost ALWAYS the easiest way to handle stuff like this, especially when you want to avoid mucking up your Blender files or FBX files.

    Steps to success for each item:

    - make an empty GameObject

    - drag your current art in as a child of that

    - adjust up down

    - drag the empty GameObject into Project to make a prefab

    - IMPORTANT: always use that Prefab from now on
     
    kittik likes this.