Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

So many prefabs on scene

Discussion in 'Scripting' started by overclock, Nov 3, 2014.

  1. overclock

    overclock

    Joined:
    Apr 25, 2013
    Posts:
    5
    Hi guys.
    i'm newbie in unity. I want to create scene with terrain over 100 km with plants, trees, animals, weather etc.
    I have scripts for weather, simple animal ai, scripts for growing trees and plants. Player can chop any tree and harvest any plant. Player can kill any animal. But i have very big legs. Can someone explain me about loading prefabs in scene? As example, on scene i have 300 animals, 2k trees + other scripts. Every tree has some script for calculation self state, every animal has some scripts for moving, eating etc. How i can optimize that?
     
  2. toreau

    toreau

    Joined:
    Feb 8, 2014
    Posts:
    204
    Are you planning to have a scene measuring 100 square KILOMETERS? Good luck with that. ;)

    I don't understand your question, though;
    How are you getting all the objects into the scene now?
     
  3. overclock

    overclock

    Joined:
    Apr 25, 2013
    Posts:
    5

    Sorry for my english :)
    I mean about runtime loading. Something like LOD or chunks system.
    But when i'll use growing tree, and i'll use LOD system, how i can know about current growing status for eny tree, which will be unloaded from scene
     
  4. IsGreen

    IsGreen

    Joined:
    Jan 17, 2014
    Posts:
    206
    Like Skyrim? Having many objects in the scene or large scene slow Unity editor. And it's almost impossible to do anything.

    I tried it once. And it is better to create several field(Terrain) instead of a big one.

    That is, create a field (small Terrain) and add it textures, bushes, trees, rocks, buildings, characters, etc ... All of this parent to GameObject (chunk) and create a prefab. Then you remove it and go back to create an adjacent field.

    Otherwise, if you put a lot of objects in the scene editor jumps and will not let you do almost anything.
     
  5. overclock

    overclock

    Joined:
    Apr 25, 2013
    Posts:
    5
    ok, understood. Thanks