- Home /
Best way to determine who is the clicker (doing the mouse clicking)
I have an object that I am clicking. I want to put my player stats in the controller object and then update the controllers stats when the player collects an item. I plan to have multiple players (and controllers) in the scene.
Is there an object that is specifically for the player who loaded the game? (I found out this is a yes, it is part of the "Network" API. Though I still haven't answered my question about how to best determine the clicker. If I put all the checks in the player objects it would be a lot more messy coding than it would be to have the objects themselves store it.)
Do I need to do ray casting and if so what function names would I use and how would I check who the initiator was? (don't need code example, willing to study if it will actually work)
(currently using OnMouseDown() but I don't believe that gives you the initiator)