Search Unity

Interacting with Terrain Objects (Trees, grass, etc)

Discussion in 'Scripting' started by empirebattles, Dec 27, 2018.

  1. empirebattles

    empirebattles

    Joined:
    May 17, 2013
    Posts:
    19
    I am working on some scenes in which i need the player to be able to 'destroy' a tree, grass, etc etc (paintable terrain objects), and have it be saved that they destroyed it.
    The scene itself is used more as a 'template' for a level. So I assume the process would go something like:

    [Player Loads level]-> [Player destroys trees]->[Game stores information of which trees were destroyed (serialize)]->[Player exits level, and returns (scene change/reload)]->[Scene checks for which objects have been destroyed, and does not generate them on scene load (effectively removing them from that 'save' of the game)].


    I believe i have found a bit about how to remove them from the scene at run time, but those changes only stay effective while the scene is loaded. Once the scene is closed, and re-loaded, the terrain just regenerates normally (as it should).

    What is the right/efficient way to tell the terrain which tree's in the scene to load, and which not to load?

    Thanks


    Sidenote: I'm new to unity (have only dabbled in a few things here and there). Sorry if this is a blatantly stupid question.