using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; Dont forget to Dellet #yourScriptName and write your Script Name... public class ScoreGround : MonoBehaviour { public GameObject WinTextOfPlayer1; public GameObject WinTextOfPlayer2; public GameObject RestartButton; // Start is called before the first frame update void Start() { WinTextOfPlayer2.SetActive(false); WinTextOfPlayer1.SetActive(false); RestartButton.SetActive(false); } // Update is called once per frame void Update() { } void OnCollisionEnter2D(Collision2D collision){ //Write your first Character Name instead of YourPlayer1Name... if(collision.gameObject.name == "YourPlayer1Name" ){ WinTextOfPlayer1.SetActive(true); WinTextOfPlayer1.SetActive(true); RestartButton.SetActive(true); } //Write your second Character Name instead of YourPlayer2Name... if(collision.gameObject.name == ("YourPlayer2Name") ){ WinTextOfPlayer2.SetActive(true); WinTextOfPlayer1.SetActive(true); RestartButton.SetActive(true); } } }