Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by ElChileVengador · Sep 16, 2015 at 12:28 PM · networkingrpcsynchronizationsync

Did not find target warning when using uNet

Hi everybody,

I'm new to uNet and I'm having issues synching up the client and the server. I'm using a matchManager script to parse communication between server and clients. It is a scene object that exists only in the host (using the NetworkIdentity's "Server Only") and it handles the Command and RPCCallback methods.

The problem is that it is only communicating correctly with the host, not on the clients. I don't get any errors, but when using the editor as a client I get a "Did not find target for sync message for 1" warning and 2 "Did not find target for RPC message for 1" warnings. I honestly am not sure what these mean, or how to begin debugging for them, and I couldn't find references to these warnings in the documentation. Could anyone please point me in the right direction? In advance, thank you.

The code is below:

 using UnityEngine;
 using UnityEngine.Networking;
 using System.Collections;
 
 public class MatchManager : NetworkBehaviour {
 
     /***************************************************
      * This class controls the state of a match; this 
      * includes the player health, the phase each player 
      * is in and what cards were sent to each other
      * it only runs on the host
      * ************************************************/
      [SyncVar] public Turn_Manager turnManagerPlayerOne;
      [SyncVar] public Turn_Manager turnManagerPlayerTwo;
 
     public bool waitForPlayerFlag = false;
 
     [Command]
     public void CmdSetPlayer(int _playerID, GameObject _matchManagerGO)
     {
         // get the appropriate turnmanager
         var _turnManager = _matchManagerGO.GetComponent<PlayerNetworkSetUp>().GetTurnManager ();
         // if the id is 0, then its the host
         if (_playerID == 0) {
             turnManagerPlayerOne = _turnManager;
         // if not its the second player
         } else if (_playerID == 1) { 
             turnManagerPlayerTwo = _turnManager;
         // if there's no one, there is an error
         } else {
             Debug.LogError ("there is no such thing as a player " + _playerID);
         }
     
         // if we are not already waiting, start waiting
         if(!waitForPlayerFlag)
             StartCoroutine ("WaitForTwoPlayers");
     }
 
     IEnumerator WaitForTwoPlayers()
     {
         // set the waiting flag
         waitForPlayerFlag = true;
 
         // while enabled
         while (this.enabled) {
             // if we don't have both players keep waiting
             if (turnManagerPlayerOne != null && turnManagerPlayerTwo != null) {
                 
                 Debug.Log ("we have two players");
                 RpcSetPlayerOneTurnPhase(Turn_Manager.TurnPhase.ForgePhase);
                 RpcSetPlayerTwoTurnPhase(Turn_Manager.TurnPhase.ForgePhase);
                 break;
             } else {
                 yield return new WaitForEndOfFrame();
             }
 
 
         }// end while
     }//end coroutine
 
     [ClientCallback]
     [ClientRpc]
     void RpcSetPlayerOneTurnPhase( Turn_Manager.TurnPhase _newPhase)
     {
             Debug.Log("sending instruction to player one to go to "+_newPhase);
             turnManagerPlayerOne.SetCurrentTurnPhase (_newPhase);
     }
 
     [ClientCallback]
     [ClientRpc]
     void RpcSetPlayerTwoTurnPhase( Turn_Manager.TurnPhase _newPhase)
     {
             Debug.Log("sending instruction to player two to go to "+_newPhase);
             turnManagerPlayerTwo.SetCurrentTurnPhase (_newPhase);
     }
 }


The CmdSetPlayer method is called from playerNetworkSetupScript.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by awalltoo · Oct 26, 2015 at 03:57 PM

I'd guess that the issue is that this object exists only on the server. Whenever it tries to sync the value of one of its SyncVars or call an Rpc, it tries to find the matching object on the client, but that object doesn't exist. Ultimately, giving an object SyncVars or synchronized function calls and then making it exist only on the server kind of work at cross-purposes. Given what you're trying to do, you're probably best off unchecking the "Server Only" box on this object.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ElChileVengador · Oct 26, 2015 at 04:25 PM 0
Share

Yup that did it! Thanks awalltoo

avatar image KevinHagen · Apr 15, 2017 at 08:14 AM 0
Share

Hey Guys!

We just started with Networking for Unity in our class at university. I get the same warning message, but i cant find an object in our scene where we checked the "Server Only" box for the network Identity component - is there any other possible origin for this warning ?

$$anonymous$$y second question to this topic: What does this warning tell me? It doesnt seem to have an effect, since everything still works as intended.

Hope im not making up too big topics right now, if so im sorry for bothering!

avatar image wanted748 · Nov 02, 2018 at 09:09 PM 0
Share

Thanks a ton. The object was set to server only from where i was sending the clientrpc commands. Removing server only check fixed it.

avatar image
0

Answer by yoHasse · Jan 30, 2018 at 02:24 PM

For anyone having the same error but the solution doesn't work:


I had two NetworkTransformChild components that tried to access two disabled GameObjects. Be sure that every enabled network component is able to access their specified gameobject/component

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by MostHated · May 07, 2018 at 04:39 PM

Is there a way to know what something is trying to access, or to see what things netid's are?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Networking Sync SetActive Not Working 0 Answers

How fast do Syncvars synchronize? 1 Answer

Sending Animation Over Network 0 Answers

Help| Sync' boolean variable (Friendly Fire) 0 Answers

[Unet] Did not find target for sync message for 1. Delayed Spawn information 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges