title: how to use DontDestroyOnLoad?
body: <p>So this is probably quite easy but I've never used DontDestroyOnLoad() before and don't know what to do. I have some values in a script I'd like to keep when switching to another screen and I saw that DontDestroyOnLoad() could help me with that but it doesn't seem to work hers my code </p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class data_transfer : MonoBehaviour
  {
      DontDestroyOnLoad(transform.gameObject);
  }
  </code></pre>
  
  <p>I get this error message: <code>Assets\scripts\data_transfer.cs(7,43): error CS1001: Identifier expected</code>
  like I said this is probably relatively easy but I'm new to unity and C# so thank you if you want to help.</p>