title: Can't properly use variable from other script in Unity
body: <p>I have following problem, so i can't use variable form other script. In my game there is difficulty select screen, and when user choose it's level it should give proper value to variable. Script looks like this:</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  using UnityEngine.SceneManagement;
  
  public class DifManager : MonoBehaviour
  {
  public float dif;
  
  public void easy()
  {
      dif = 1.05f;
      SceneManager.LoadScene(&quot;matchlenght&quot;);
  }
  
  public void normal()
  {
      dif = 1.15f;
      SceneManager.LoadScene(&quot;matchlenght&quot;);
  }
  
  public void hard()
  {
      dif = 1.4f;
      SceneManager.LoadScene(&quot;matchlenght&quot;);
  }
  }
  </code></pre>
  <p>In another script on the gameplay scene i want to use dif variable to set DifficultyMultiplier and it looks like it:</p>
  <pre><code>using UnityEngine;
  
  public class Ball2 : MonoBehaviour
  {
  
  private matchlength mlength;
  public float difficultMultiplier;
  public float minXspeed = 0.8f;
  public float maxXspeed = 1.2f;
  
  public float minYspeed = 0.8f;
  public float maxYspeed = 1.2f;
  public DifManager d;
  private Rigidbody2D ballRigidbody;
  private GameObject secondPaddle;
  
  // Start is called before the first frame update
  void Start()
  {
      d = gameObject.GetComponent&lt;DifManager&gt;();
      secondPaddle = GameObject.Find(&quot;Paddle2&quot;);
      difficultMultiplier = d.dif;
      mlength = gameObject.GetComponent&lt;matchlength&gt;();
      ballRigidbody = GetComponent&lt;Rigidbody2D&gt;();
      ballRigidbody.velocity = new Vector2(Random.Range(minXspeed, maxXspeed) * (Random.value &gt; 0.5f ? 
       -1 : 1), Random.Range(minYspeed, maxYspeed) * (Random.value &gt; 0.5f ? -1 : 1));
      
  }
  </code></pre>
  <p>I'm still getting error about Null reference, so i suppose that is something wrong with getting proper value. What am i doing wrong? Please help me.</p>