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 /
This question was closed Apr 20, 2014 at 01:56 PM by Benproductions1 for the following reason:

Other

This post has been wikified, any user with enough reputation can edit it.
avatar image
0
Question by dipixoft · Apr 19, 2014 at 02:43 AM · networkingnetworksendmessageonline

send message by networking

Hi, again, i'm here because i have a problem, i'm trying to access to a networkplayer, how can i send message by networking i've tried this but i get an error, here's the code

 function OnTriggerStay(otro : Collider)
 {
                 if(otro.gameObject.tag == "Player")
                 {
                     if(otro.GetComponent(MovimientoJugadorBasico)){                        
                         if(modoAtaque){
                         if((Input.GetButtonUp("punch")  || Input.GetButtonUp("kick")))
                         
                         //otro.GetComponent(MovimientoJugadorBasico).recibirAtaque(modoAtaque,hit);
                         var viewID = otro.collider.networkView.viewID;
                         networkView.RPC("aplicar",RPCMode.All,viewID,otro.gameObject.name);                        
                         }
                         otro.GetComponent(MovimientoJugadorBasico).herido = modoAtaque;
                     }
                 }
 }
 

and the RPC function

 @RPC
 function aplicar(id : NetworkViewID, d : String)
 {
     var enID = NetworkView.Find(id);
     var en = enID.observed.gameObject;
     
     en.gameObject.SendMessageUpwards("recibirAtaque",hit,SendMessageOptions.DontRequireReceiver);
     
 
 }


if you know other way, please help me

Comment
Add comment · Show 3
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 Benproductions1 · Apr 19, 2014 at 10:16 AM 0
Share

"i've tried this but i get an error" and you didn't post the error why?

avatar image Minchuilla · Apr 19, 2014 at 03:22 PM 0
Share

Note that an RPC call can only be received by the same script or other scripts that belong to the same object.

Just to make sure check that you have a networkView attached to your GameObject

avatar image dipixoft · Apr 19, 2014 at 06:11 PM 0
Share

thanks i've solved :D the problem

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

22 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

Related Questions

Implementing a news feed into my application 1 Answer

Going from LAN to WAN (UNet Online) 2 Answers

Network Communication - sending packets without RPC/NetworkView? 0 Answers

Is the master server down? 0 Answers

Testing my multiplayer character offline 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