Hey Idk but why does this script not work it#s a hover script

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class hover : MonoBehaviour {

public TextMesh Text1;
public TextMesh Text2;

public GameObject HoverObject;

// Use this for initialization
void Start () {
	Text1.text = "New Game";
	Text2.text = "Continue";
}

// Update is called once per frame
void Update () {
	
}

void OnMouseOver() {
	Hover ();
	if (GameObject = Newgame) {
		HoverObject = "Newgame";
	}

	if (GameObject = Continue) {
		HoverObject = "Continue";
	}
}

void OnMouseExit() {
	Exit ();
}

public void Hover() {
	if (HoverObject = "Newgame") {
		print ("test");
	}

	if (HoverObject = "Continue") {
		print ("test1");
	}
}

public void Exit() {

}

}

You never define variables for NewGame and Continue.
They need to be defined somewhere.

if (GameObject = Newgame) {
         HoverObject = "Newgame";
     }
     if (GameObject = Continue) {
         HoverObject = "Continue";
     }

You have quite a few things wrong with this script, but I’ll try to point them out for you- let me know if this helps. Also, it would be helpful for you to provide the errors you’re getting with your code, and what exactly isn’t working/what you’re trying to accomplish. First of all, you’re trying to compare “Gameobject” with “NewGame” Neither of these objects have been declared/initialized. Same with when you’re comparing “Continue” to a Gameobject. One other thing is if you’re comparing two strings, you should use the .equals method. Let me know if that helps.

These if statements are formatted wrong.

if (HoverObject = "Newgame") {

should be

if (HoverObject == "Newgame") {

a single equals sign = sets a variable to a new value. Two equals signs == compares whether values are equal. Also, HoverObject is a gameobject, and will never be equal to “Newgame” or any other typed string. You should compare it’s name. if (HoverObject.name == "Newgame"). I think you would benefit from studying C# basics - as Unity answers can be a little unforgiving for high volumes of beginner mistakes. Check out the Unity Learn section, or other various C# tutorials on the internet to improve your skills.