- Home /
How to detect specific gameObject on Client Side
I have been working on a mobile multiplayer game. Currently I am facing a problem. I can instantiate a homing missile from "Client A" and I want to update that homing missile's location my "Client B" regularly.
But the problem is there can be more than one active homing missile in the scene. And because every missile would have different positions in the scene, I have to identify which one to update with the information sent from "Client A". But I dont know how to select the right one and do the right position update.
How can I solve this problem?
Note: I am using Google Play Services for network operations.
Answer by Casiell · Aug 27, 2018 at 05:10 PM
I suspect you are using unet.
If that's the case, then each missile has to have NetworkIdentity which offers you netID which is unique for each object and is the same on each client and server.
Edit: To elaborate, you can find object by ID using this method. Also when invoking RPC and Command methods you can pass NetworkIdentity component as a parameter
Actually I am using google play services for network operations.
Then sorry, I can't help you. You should edit your question with this info, it's quite vital for your problem.
If there is no mechanism for that, you could add your own ID system that your server could set on all clients when instantiating. I'm not sure if this is possible, just an idea
Your answer
Follow this Question
Related Questions
Homing Missile update on client 1 Answer
Player interaction in multiplayer. 0 Answers
UNET Client Cant Send Server Commands, Host Can. 1 Answer
Confusing in Multiplayer Networking uNet Client-Server 0 Answers
Order of Execution in Multiplayer 2 Answers