Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by MasterGalaxy · Oct 07, 2015 at 12:24 AM · javascriptnetworkingnetworkspawncommand

UnityScript not recognizing NetworkServer "Unknown Identifier"

So I've been tinkering with this script now for multiple days and can't get it to work. My problem is that I've coded the rest of my scripts up until this point in Unity JavaScript, no C# at all, just because I call variables from one script to another pretty often and that doesn't work very well from C# to JavaScript or vise versa.

So now that I'm working with networking, and the documentation is practically non-existent in the scripting API, and the manual seems to use C# exclusively, I'm a bit lost...

My script is set as:

public class "scriptname" extends Networking.NetworkBehaviour

This is because Unity throws an error when I don't add "Networking" which is fine except the same holds true across the board. This creates a problem when I need to run a command as when I add @Networking.Command Unity refuses to recognize any "Networking." anything in the function, and removing Networking doesn't help either...

I know my explanation is really jumbled, but maybe I'll post the script if it's needed. I just want to make sure this isn't just a bug or something I can fix with a simple reinstall...

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

1 Reply

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

Answer by Bunny83 · Oct 07, 2015 at 02:08 AM

Are you familiar with the concept of namespaces? The new network classes are inside a seperate namespace called "Networking". If you want to use a class from a namespace you either have to use the full classname including the namespace (just as you found out yourself) or, which is the common way, place an "import" statement at the top of your script file. In C# it's called "using".

 import UnityEngine.Networking;

Same applies to the new UI system which has it's classes in the UnityEngine.UI namespace.

If you look at the docs of NetworkBehaviour at the very top, right after the class name is states:

class in UnityEngine.Networking / Inherits from: MonoBehaviour

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

36 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

Related Questions

How to network spawn an object from a downloaded asset bundle 0 Answers

UNET Network.Spawn and child objects 1 Answer

Connection to a registered host not working 1 Answer

Calling Command Function from Client results in "NetworkServer not active..." 1 Answer

network card game 2 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