One GameObject, two scenes

I’m currently working on a 2d platform bike based game. I’ve created a customise scene where you can change the colour of the bike, but when you hit play and the main scene loads, the colour changes don’t appear. Is there a way to have one gameObject in two scenes, so the changes from one scene affect the other? I’m working in C# btw


You can use DontDestroyOnLoad to insert the bike from the customize scene to the main scene, when you load it.

There are different ways you can achieve this. Two of the most common:

  1. Have the object created in only one scene (like the initial scene) and mark it so that it will not be destroyed automatically when loading a new scene.


public class example : MonoBehaviour {
    void Awake() {
  1. Make the bike a prefab. Then instantiate a GameObject from that prefab in each scene when it starts up. Then you can modify the prefab (like the color) and the copies that are created at runtime will have that color regardless of what scene that is done in.