• 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
Question by missypooh · Mar 23, 2012 at 09:43 AM · rpcnetworkview

RPC Call error

openableDoor1.js

 if(correct)
         {
             R01aa.active = true;    // Set gameobject to active
             MoveAround.rad1a = false;
             //choice = false;
             score1 = score1 +100;
             networkView.RPC("updateScores", RPCMode.Server, score1);
         }


//server @RPC

 function updateScores(player: NetworkPlayer, nScore : int)
 {
     print("I am inside gamesetup updateScores RPC");
     var newEntry : FPSPlayerNode = new FPSPlayerNode();
     
     newEntry.playerName=name;
     newEntry.score = nScore;
     playerList.Add(newEntry);
     
     networkView.RPC("UpdateScore", RPCMode.AllBuffered, player, nScore);
     
 }

RPC call failed because the function 'updateScores' does not exist in the any script attached to'Door1'.

I don't know what the problem with it. Please help

Comment
maraoz

People who like this

1 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 farooqaaa · Mar 23, 2012 at 09:50 AM 0
Share

Check this question:

http://answers.unity3d.com/questions/21221/force-a-rpc-to-be-called-on-a-networkview-of-anoth.html

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by Chain · Mar 23, 2012 at 03:34 PM

Dont you need a reference to the script w$$anonymous$$ch contains the RPC you want to send? like t$$anonymous$$s:

 GameObject go = GameObject.Find("fooObject"); //Gameobject w$$anonymous$$ch
                                               //holds the script with the RPC
 fooScriptClassName bm = go.GetComponent<fooScriptClassName>();

 go.networkView.RPC("UpdateScore", RPCMode.AllBuffered, player, nScore);

And are RPCs not in t$$anonymous$$s style:

 [RPC]
 void foobar(foo foooovar)
 {
 }

i hope t$$anonymous$$s helps :)

greets chain

Comment
maraoz

People who like this

1 Show 1 · 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 missypooh · Mar 23, 2012 at 03:54 PM 0
Share

Hmm... Actually i am not very familiar with RPC call. Basically i am using M2H networking tutorial example4 (FPS setup) for my games. So now basically i want to update the score table. But somehow it doesn't go the way i want it to be like. I will post another question on it. so please help too. :) thanks

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Help with Network Script. Game with multiple Maps. 2 Answers

RPC calls are slowing down exponentially... 1 Answer

RPC or Synchronization ? 1 Answer

Generic RPC Call 1 Answer

Networking: RPC To Specific Player? 1 Answer


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