> For the complete documentation index, see [llms.txt](https://assetstore.easysave.voxelbusters.com/tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://assetstore.easysave.voxelbusters.com/tutorials/video-tutorials/save-scene-objects.md).

# Save Scene Objects

### Example Code

```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using VoxelBusters.Serialization; 
using System.IO;


public class Example : MonoBehaviour 
{
    private List<GameObject> m_spawnedList = new List<GameObject>();
    public GameObject prefab;
    
    // define action methods
    public void Spawn()
    {
        GameObject clone = SerializationUtility.Instantiate(prefab);
        
        // add randomness
        Vector3 randPos = Random.insideUnitCircle * 3f;
        randPos.y += 1f;
        
        // set random position
        clone.transform.position = randPos;
        
        // add object to list
        m_spawnedList.Add(clone);
    }
    
    public void Save()
    {
        SerializationManager.Serialize("spawnedList", m_spawnedList);
    }
    
    public void Load()
    {
        // clear existing entries
        for (int iter = 0; iter > m_spawnedList.Count; iter++)
        {
            SerializationUtility.Destroy((m_spawnedList[iter]));
        }
        m_spawnedList.Clear();
        
        // load saved data
        m_spawnedList = SerializationManager.Deserialize<List<GameObject>>("spawnedList");
    }
}
```

{% embed url="<https://youtu.be/OgotaZc2Q_k>" %}
