So i am making my first game , its something like 2d volleyball .
I’ve made it so when the ball touches the ground it displays a text to restart the game.
What i want to do is to display the text when it touches the ground Twice.
This is the script.
public bool groundContact = false;
public Transform ball;
private float groundRadius = 0.6f;
public LayerMask groundLayer;
public GUIText RestartText;
void Start ()
{
RestartText.text = "";
}
void FixedUpdate ()
{
groundContact = Physics2D.OverlapCircle (ball.position, groundRadius, groundLayer);
if (groundContact)
{
RestartText.text = "Press 'R' to Restart";
}