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, ^^