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
0
Question by jorgon · Oct 26, 2011 at 04:19 PM · networkingserverclientsmartfox

Do I need Smartfox server for a client and server in different "rooms" or scenes or scenearios?

Hello my friends.

Do you know If I need SmartFox server for doing this instead the built in capabilities of Unity3D in networking?

My idea is: to create a game in which one player starts to play in an scenario, in a forest, and there's a "super-user" in other PC who controls certain parameters like the difficulty level and others. It's strange that something so simple can't be managed byself in Unity: only two players but in different scenarios. I've created my two applications (a web client) and a server version but the last one instead of going after clicking in a button of my menu scene (common for both versions) to the forest (just like in the client version) goes to a scene/scenario/level where appears a serie of buttons for controlling some parameters like the level of difficulty or the appearing/spawning of enemies...

I receive the message when I click a button in my server version:

Level 'globo' (-1) couldn't be loaded because it has not been added to the build settings. To add a level to the build settings use the menu File->Build Settings... UnityEngine.Application:LoadLevel(String) $:MoveNext() (at Assets/Scripts/NetworkLevelLoad.js:40)

I tried to build two different games with different scenarios at each level and the debugger tell me this error message: I can't modify any global variable due to the change of the name of the scene at level2 (when I build one of both versions of my game).

I think I'm gonna start to study SmartFox... :-( As one friend has recommended to me...

But before that I wanted to know your opinion.

Please, remember I'm ompletely new at networking with Unity3D.

Thanks in advance.

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 jorgon · Oct 27, 2011 at 12:07 PM 0
Share

I've tried to create for both versions the same project and loaded one or another level depending on whether you are the client or the server. And after checking that client can connect to the server and each one within his own scene I'm trying to modify a script (for example) from the server's scene to the client scene via this code:

 function OnGUI () {
 if (GUI.Button(new Rect(500,500,250,20),"turn_off_the_script"))
 print("click_on_the_button");
 networkView.RPC ("off", RPC$$anonymous$$ode.All);
 print("llamo a la función");

}

 @RPC
 function off ()
 {
     var go = GameObject.Find("Generator");
     print("object_found");
     go.GetComponent("script_to_turn_off").enabled=false;
     print("script_turned_off");
  }

But unfortunatelly I receive the next error message:

NullReferenceException UnityEngine.GameObject.GetComponent (System.String type) (at C:/BuildAgent/work/6bc5f79e0a4296d6/Runtime/ExportGenerated/Editor/BaseClass.cs:185) Botones_menu.deshabilita_lluvia () (at Assets/Scripts/Botones_menu.js:23) UnityEngine.NetworkView:RPC(String, RPC$$anonymous$$ode, Object[]) Botones_menu:OnGUI() (at Assets/Scripts/Botones_menu.js:15)

It seems that It can't find the component / script. Is my code correct?. In this case, maybe is it possible because of I'm using different scenes for each game version (one for the server which is the code I've posted before in this post) through the code, inside the code I select one or other scene depending on whether I'm server or client.

Thank you in advance.

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

2 People are following this question.

avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

OnConnectedToServer not called when testing on same machine 0 Answers

Why can't the client move a networked object ? 1 Answer

Need help getting "Server Reconciliation" to work. 0 Answers

Networking between projects: how to send ViewIDs? 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