Reference to local player on multiplayer?

I have been looking for an answer to this for a few days now, and haven't been able to figure it out. Even after trying the forums and IRC, I've come up with nothing, >.<

I've got an object, in my multiplayer game, that uses an OnMouseOver function to show it's information as a toolTip for the player. Now, when this is happening, the player's script needs to know that it's mouse is over something that is interactable. This is done in the player's script with a simple mouseOver boolean that is switched to true.

My problem is, I cannot find a way to reference the player's script with the object's script, so that it knows to change its variable. It is a multiplayer game, with multiple players, as well as multiple of these types of objects on the server, each of which use the same scripts. This being the case, all I need is a reference to the local playerController so that I can get their script component to change the variable.

I read a few things about using Network.player with an array of playerController gameobjects, but after plugging that into my project, Unity now crashes whenever my mouse goes over one of these objects... so I'm guessing that it probably won't work, or I'm not using it right, lol.

I've have had people explain to me that I just need to assign each player an ID number of some kind and use that... but what they don't understand is that it's not a matter of ID's, its just finding which player is initiating the OnMouseOver of the object.

Now, the OnMouseOver function, unless I'm mistaken, is only readable on the local client... so if another player mouses over an object, my client won't know that. This being the case, I believe I could just find the localPlayer gameobject, and use reference that.

If anyone has any ideas, I would really appreciate it - I'm not looking for a whole script or anything, just trying to find a way to get this reference, xP

Thank you, in advance, ^^

So do you want when the other players mouse over something for all players to see a tool tip about it or do you only want each locally to see the tool tip when they mouse over something?

I’m fairly certain that OnMouseOver is handled locally, which means it would only be when the local player mouses over the object that the script inside were triggered, and it would only do this from their machine. Potentially, if you wanted to, you could have that trigger scripts on the other player’s machines, but that’s not exactly what you were looking for so I won’t go into much more detail on that.

However, in order to ensure that the properties are being changed on that specific player, you may want to contain them in one of these blocks:

if(networkView.isMine)
{
   //Whatever you want it to do
}

Or you may want to start fiddling around with NetworkPlayer.ipAddress.

Which of these methods you should use (if not both)depends entirely upon specifically how you’ve set up your network, and how you choose to go about accomplishing that goal.