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 Vadymka · Jul 26, 2014 at 02:23 PM · error

whats causing this error?

 NullReferenceException: Object reference not set to an instance of an object
 Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
 Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)
 Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
 NetworkManagerBetter+$lobbySpawn$32+$.MoveNext () (at Assets/RPG/NETWORK/NetworkManagerBetter.js:169)
 

help please alt text

EDIT: fixed, it didn't have a component, but how to make it look for a component inside the player parent? 'cause player is just a parent, inside it theres the player object with the component

Comment
Add comment · Show 5
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 ShadoX · Jul 26, 2014 at 02:25 PM 0
Share

are you sure that the object named "made" has some value and that you don't just define it as

Object made;

or something along those lines ? or that the object has a component named "SCR_player$$anonymous$$ove" ?

avatar image Landern · Jul 26, 2014 at 02:27 PM 0
Share

A references object is null, that could be the object made, the attempt to get the script component SCR_player$$anonymous$$ove returned null but than you tried to set the field/property playerName which of course wouldn't exist if the component was not found.

avatar image Vadymka · Jul 26, 2014 at 02:27 PM 0
Share

ShadoX: hmm, var made = Network.Instantiate(playerPrefab, transform.position, transform.rotation, 0);

avatar image Vadymka · Jul 26, 2014 at 02:31 PM 0
Share

fixed, it didn't have a component, but how to make it look for a component inside the player parent? 'cause player is just a parent, inside it theres the player object with the component

avatar image incorrect · Jul 26, 2014 at 02:32 PM 0
Share

Try finding out which object is null. Comment that line and ins$$anonymous$$d add this lines after or before it:

 Debug.Log(made);
 Debug.Log(made.GetComponent(SCR_player$$anonymous$$ove));
 Debug.Log(made.GetComponent(SCR_player$$anonymous$$ove).playerName);

1 Reply

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

Answer by dsada · Jul 26, 2014 at 02:29 PM

Without the context no one can tell more than either your GameObject named "made" is null or it hasnt got SCR_playerMove type component.

Try to debug.Log them before this line.

     if(made == null)
     {
        Debug.Log("made is null");
     }
     else
     {
        if(made.GetComponent<SCR_playerMove>() == null)
        {
           Debug.Log("hastn got the component");
        }
     }

And you will get the problem

Comment
Add comment · Show 2 · 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 Vadymka · Jul 26, 2014 at 02:36 PM 0
Share

fixed, it didn't have a component, but how to make it look for a component inside the player parent? 'cause player is just a parent, inside it theres the player object with the component

avatar image dsada · Jul 26, 2014 at 03:10 PM 0
Share

If u would like to find component in children:

 made.GetComponentInChildren<SCR_player$$anonymous$$ove>();

if u would like to find component in parent:

 made.transform.parent.gameObject.GetComponent<SCR_player$$anonymous$$ove>();

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers

NullReferenceException trouble 1 Answer

Assets/cubeAI.js(2,11): UCE0001: ';' expected. Insert a semicolon at the end. 1 Answer

Unity error "scripts exist in multiple locations" 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