Hello, I'm trying to print the name of the game object that i am flying over with my mouse in C#, likes this JS code :
function OnMouseEnter() {
Debug.Log(gameObject.name + " OnMouseOver");
}
thanks
Hello, I'm trying to print the name of the game object that i am flying over with my mouse in C#, likes this JS code :
function OnMouseEnter() {
Debug.Log(gameObject.name + " OnMouseOver");
}
thanks
Should just be this:
void OnMouseEnter() {
Debug.Log(gameObject.name + " OnMouseOver");
}
Edit:
And just in case you want a full class (change YourFileName to the filename you made in the project view):
using UnityEngine;
public class YourFileName : MonoBehaviour
{
void OnMouseEnter() {
Debug.Log(gameObject.name + " OnMouseOver");
}
}