I have multiple gameObjects with this script on them. The only gameObject that properly changes the ToolTipText to what’s set in the inspector is the gameObject that first received the script (I’m guessing some sort of timestamp is being used). All subsequent gameObjects to receive the script change the ToolTipText to “”;
Am I not comparing object’s correctly? Other methods I’ve tried give me a Cannot convert ‘String’ to ‘UnityEngine.GameObject’
var cam : Transform = gameObject.Find("CameraRight").transform;
var ray = new Ray(cam.position, cam.forward);
var hit : RaycastHit;
if(Physics.Raycast (ray, hit, 500))
{
if (hit.collider.gameObject.name == gameObject.name)
{
meshTtt.GetComponent(TextMesh).text = ToolTipText
}
else
{
meshTtt.GetComponent(TextMesh).text = "";
}
This happens if I compare tags as well…
if (hit.collider.gameObject.tag == "isPlanePart")
Thanks for any help!