Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 vbqb1818 · May 13 at 03:59 PM · networkingmirror

How do you use a mirror network to enable player a to set up the canvas of player b?,mirror network a -> b player canvas open how??? please

Papago It may look strange using a translator.

I want to deliver the ball value from client a to client b. The only knowledge I know is synchronization using syncvar, command, and clientrpc, but I'm not sure if I should use msg send. Here's the problem.

When I say player A in the game, I want to get close to player B and press the interaction key to see the message "Do you want to request a team member?" on player A's screen when I press OK, and on player B's screen, "Do you want to accept player A's request?" The problem is that you can see the message on Player A's screen, but the message appears on Player B's screen. So far, when player A pressed the interaction key to player B with ray.hit, player A's script set the hit.collider.getcomponent<>().bool variable to true and used syncvarhook, command, and clientrpc to pass the changed value to the client. By the way, no. What method should I use to change the variable of the hit client and represent the canvas panel?

 foreach (RaycastHit2D x in hitMan)
          {
              if (x.collider.CompareTag("OtherPlayer") && temp == 0)
              {
                  Debug.Log("team request accept : " + x.collider.gameObject.name);
                  x.collider.GetComponent<Attack>().TestA(true);
                  temp++;
              }
              else
              {
  
              }
  
  
          }
  
  public void TestA(bool t)
      {
          if (t)
          {
              CmdTestA(t);
              // Debug.Log(gameObject.name + "teamRequestAccept : " + t + "hasau" + hasAuthority);
              GameObject.Find("Canvas").transform.GetChild(5).gameObject.SetActive(true);
          }
          else if (t == false)
          {
              // Debug.Log(gameObject.name + "teamRequestAccept : " + t + "hasau" + hasAuthority);
              GameObject.Find("Canvas").transform.GetChild(5).gameObject.SetActive(false);
          }
      }
  
  [SyncVar(hook = nameof(SetTeamRequestAccept_Hook))]
      public bool teamRequestAccept;
      public void SetTeamRequestAccept_Hook(bool old, bool n)
      {
          teamRequestAccept = n;
      }
  
  [Command (requiresAuthority = false)]
      public void CmdTestA(bool t)
      {
          RpcTestA(t);
          Debug.Log(gameObject.name + " command");
          this.teamRequestAccept = t;
      }
  
      [ClientRpc]
      public void RpcTestA(bool t)
      {
          Debug.Log(gameObject.name + " clientrpc");
          this.teamRequestAccept = t;
      }
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

0 Replies

· Add your reply
  • Sort: 

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

189 People are following this question.

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

Related Questions

Animations playing only in the Host and not on the clients - Unity Mirror Networking. 1 Answer

Loading texures from client-owned PNG files in Mirror 0 Answers

Mirror networking weird behaviour. 0 Answers

How to only authorise Rotation? -using MirrorNetworking 1 Answer

Rpc client not functioning as expected (Mirror networking) 0 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