[UNET] Finding the ID of a network message

Hello~

I’m having an issue developing my networked game.
I occasionally get this message when running the game(Both on client and server):

Did not find target for sync message for 28

Now, I realize what this means, but I can’t really tell which message is the one I’m having trouble with.
I couldn’t find anything of a Google search, so wondered if anyone here might know.
Where can I check what command/rpc this ID is referring to?

Thanks alot for any help~

28 is not a build-in message ID in teh HLAPI.. did you register a handler for that ID?

Sorry, maybe I wasn't clear enough. I know that this is a message I created and isn't built-in the Unity, what I asked was if there was a way to go through my defined Commands, RPCs, SyncVars, etc, and check what ID they were assigned, so I could tell which one is the one not being found?

if you look at the stack trace for that message, it is from inside "OnUpdateVarsMessage". The 28 is actually a netId. The object with netId 28 doesnt exist on the client.

1 Answer

1

A typical occurrence scenario:

You have an automated server controlled turret that shoots at enemies.

The server has spawned a bullet on the client and as its travelling straight.

The bullet collides with the enemy on the Client and tries to Destroy it.

The Physics Collision and the Destroy already happened on the Server.

There is nowhere for the Network Message to go.

I think this comes from mixing tasks between the server and client. If they are both able to influence the same objects, overlaps can occur.

As for the netId, it is no longer available if the object has been Destroyed but there are FindLocalObject(Networking.NetworkInstanceId) methods on Classes like ClientScene to find the object by id.