title: Unity Highscore reset at respawn
body: <p>I'm trying to be able to respawn as well as reset the score counting as soon as i walk into my "Gold" Object.
  As for now i'm not even able to respawn which was possible earlier before trying to implement the "Score-Stuff" (at first the "FoundGold" Script was only used to be able to respawn). Also i'm trying to make the lowest Score the High-Score.
  Note that im new to C# and i kinda put everything together from the tutorials i needed so a answer with some actual code/stating where something went wrong would be much appreciated.</p>
  
  <pre><code>//GoldFound Code
  using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  
  
  public class GoldFound : MonoBehaviour
  {
  private ScoreManager theScoreManager;
  public Transform target;
  
  [SerializeField] private Transform player;
  [SerializeField] private Transform respawnpoint;
  
  private void Start()
  {
      theScoreManager = FindObjectOfType&lt;ScoreManager&gt;();
  }
  
  
  private void OnTriggerEnter(Collider other)
  {
      theScoreManager.scoreIncreasing = false;
      player.transform.position = respawnpoint.transform.position;
      theScoreManager.scoreCount = 0;
      theScoreManager.scoreIncreasing = true;
  
  }
  
  
  }
  </code></pre>
  
  <p>other code</p>
  
  <pre><code>//ScoreManager
  using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  
  
  public class ScoreManager : MonoBehaviour
  {
  
  public Text scoreText;
  public Text hiScoreText;
  
  public float scoreCount;
  public float hiScoreCount;
  
  public float pointPerSecond;
  
  public bool scoreIncreasing; 
  
  
  // Use this for initialization
  void Start()
  {
  
  }
  
  // Update is called once per frame
  void Update()
  {
      if (scoreIncreasing)
      {
          scoreCount += pointPerSecond * Time.deltaTime;
      }
  
      if(scoreCount &gt; hiScoreCount)
      {
          hiScoreCount = scoreCount;
      }
  
  
      scoreText.text = "Score: " + Mathf.Round (scoreCount);
      hiScoreText.text = "High Score: " + Mathf.Round (hiScoreCount);
  
  }
  }
  </code></pre>