- Home /
raycast hit to player in network ,how??
i am having trouble with the RPC call ... so , i have a raycast that collects info from the hit like : the game object and then i want it to send a message or do a rpc with the damage ... but i never got it work .. my logics are client sided ... how can i get the right player from network with the raycast hit ??
the logics are like this : raycast hits > collect data from hit ( the player from network) > call a function wich damages his life
i can't get more than the raycast hits ... can someone help me please , i will be very grateful to you !!
In general terms, you need one device that is the "central HQ server".
it does all the thinking and tells the others what to do.
that's general help
nobody can help you specifically unless you post your specific code.
http://answers.unity3d.com/questions/324358/set-variable-to-another-script-in-another-gameobje.html in this question is the code
can u just explain to me how to do the : client raycast hits an gameobject wich is the other player , then it takes it's networkplayer , and sends a rpc to that player : something like : networkView("playerGetsDamaged",NetworkPlayer,damageVar);
i just can't make that ... i am new to program$$anonymous$$g too
local logistics i have no problem .. but network ... i suck
Your answer
![](https://koobas.hobune.stream/wayback/20220613081742im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Displaying players name above in multiplayer 1 Answer
Disconnect a player from a network 1 Answer
Problem with identifying players in network 1 Answer
Methods Repeats for each New Player connected 0 Answers
RPC calls to a specific client? 1 Answer