Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by Henrik Poulsen · Jul 01, 2010 at 09:40 AM · gameobjectrpcnetworkviewother

Force a RPC to be called on a networkview of another GameObject

The error I get:

RPC call failed because the function 'IAmReady' does not exist in any script attached to'GameDirector'

So I have two game objects. One is called GameDirector which manages the logic for the current scene that is loaded (I am basically doing a bunch of multiplayer minigames). The other is called Director and this game object manages the communications to the master server and keeps track of the players and a bunch of other stuff that gives as little networking overhead as possible to the minigames so one can churn them out fast.

The problem I am having is that when the two players connect to eachother and start the game I need to make sure that both players have loaded the scene before I start instantiating the player characters (otherwise the Network.Instantiate will just get lost if a client is still loading). So I send out an RPC to all players when they have loaded. So when the player has received "IAmReady" from all other players then its time to start the game.

  1. The function for the RPC is inside a script of Director
  2. These queries are started when the GameDirector calls kDirector.DoneLoading() at the end of the Start() function of the logic script in GameDirector;
  3. For some reason the RPC tries to execute for scripts attached to GameDirector rather than for Director.
  4. The networkView.RPC call and the [RPC] function are in the same script file.
  5. How do you tell the networkView that the RPC should be executed on the Director instead? kDirector.networkView.RPC yields the same result.

Comment
Add comment · Show 1
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 YeOldeSnake 1 · Jan 01, 2011 at 05:50 PM 0
Share

Post some code here as its not clear if the eror is on the code or in your setup

2 Replies

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

Answer by roamcel · Aug 02, 2011 at 05:05 PM

I hope this can help you, but to tell you the truth I was not able to make it work (seems to not even execute on my tests...)

 GetComponents(NetworkView)[i].RPC()

as written on the official documentation that could be useful in your case. http://unity3d.com/support/documentation/Components/class-NetworkView.html

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
3

Answer by portchris · Mar 02, 2012 at 12:21 AM

I managed to solve a similar(ish) problem with this:

.GetComponent(NetworkView).networkView.RPC("MyFunction", RPCMode.AllBuffered, vars);

I hope this helps you and others that have a similar issue

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

2 People are following this question.

avatar image avatar image

Related Questions

Unity crashes when doing an RPC. 1 Answer

Array of NetworkViewID passing in a RPC 1 Answer

RPC not sending and not giving an error? 0 Answers

What is the best way to properly implement shooting over a network? 1 Answer

Problem in Instantiate Gameobject Through Network 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