I am new to unity. Currently, I am working on a small project.
I am creating a solar system where the player can click on planets and the main camera will zoom in and follow that planet.
The player can also right-click on a particular planet and the name of that planet will be displayed. However, if the player re-clicked the right click again, the name will disappear (need help with that)
I used OnMouseOver with Input.GetMouseButton (see below). But I am stuck and have no idea how to stop displaying the text when the player re-click right-click.
Can anyone please help me :)
What I have used:
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(1))
{
text.SetActive(true);
}
}