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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

DontDestroyOnLoad script

Discussion in 'Scripting' started by SamVorst, Dec 21, 2019.

  1. SamVorst

    SamVorst

    Joined:
    Nov 28, 2019
    Posts:
    63
    Hi all,

    I know how DontDestroyOnLoad works... but I have a problem in my first scene is my button standing still, in my second scene its moving. So the issue is that the button must be destroyed but the script not, and in the third scene has to been everything removed!
    Does Somebody know this?

    Thanks Sam
     
  2. craig4android

    craig4android

    Joined:
    May 8, 2019
    Posts:
    124
    hmm don't think this is possible, you can only transfer a whole object from one scene to another, you can't even copy components in the same scene.

    Although I'm not sure if I get your problem correctly.
     
  3. SamVorst

    SamVorst

    Joined:
    Nov 28, 2019
    Posts:
    63
    All right, Ill gonna try it another way!
     
  4. SamVorst

    SamVorst

    Joined:
    Nov 28, 2019
    Posts:
    63
    Thanks for helping!