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 AmgedIsmail · Nov 08, 2011 at 05:40 AM · materialobjects

NullReferenceException: Object reference not set to an instance of an object

Hello, I have been learning from a series of videos for a site called BurZergArcade a RPG game. And I have been following him step by a step, line by a line code, and now I am getting this message every time I run the scene and now the abilities and skills are not shown, only the Name which is shown:

NullReferenceException: Object reference not set to an instance of an object CharacterGenerator.Start () (at Assets/Scripts/Character Classes/CharacterGenerator.cs|72)

And here are the pictures of the error, one for when I run the scene, and the other is for where the error line is located:-

alt text

alt text

I have also uploaded the whole project in case you would like to look into it and check it yourself.

PLEASE anyone help me, I cannot continue watching the videos unless this error is solved. It ANNOYS me!!! http://www.mediafire.com/?accb6mm8d1nh3a3

Thanks.

Comment
Add comment · Show 4
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 syclamoth · Nov 08, 2011 at 05:44 AM 0
Share

Ok, those pictures are totally useless to me, since they are so low-quality you can't even read the line! Why can't you just post the line of code? It'd be much more readable. Screenshots are very rarely any use for solving these problems, because if you don't know what is causing it, you don't know what you need to show for people to be able to help!

avatar image syclamoth · Nov 08, 2011 at 05:45 AM 0
Share

In any case, a null reference exception happens when you try to access a variable which hasn't been assigned. $$anonymous$$ake sure that all the variables on that line are being assigned somewhere, and check to see if they're set up in the inspector if they're public.

avatar image AmgedIsmail · Nov 08, 2011 at 06:11 AM 0
Share

Hello, It's not public I think, it's error giving me for the Name.. and when I double click on the error it sends me to line number 72 here check the picture:- It's a good quality this time, the last time it wasn't good because I used a tool to decrease the size of the picture and decreased its quality.

http://i1187.photobucket.com/albums/z393/BlackCitadel/Capture-24.jpg

avatar image syclamoth · Nov 08, 2011 at 06:34 AM 0
Share

No, I'm pretty sure it'd have to be _Toon which is null at this point. Try the line

 Debug.Log(_Toon);

immediately before you would get the NullReference, and see what that shows.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by aliakbo · Dec 02, 2011 at 12:34 AM

I found the problem!!

a copy paste error from previous videos!!

1) Go into BaseCharacter.cs. 2) Make sure your FOR loops are correct:

private void setupPrimaryAttribute()

for... _primaryAttribute[cnt] = new attribute();

..setupVitals()

for... _vital[cnt] = new vital();

..setupSkills()

for... _skill[cnt] = new skill();

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Scripting - Refering Pre-Made Objects 1 Answer

Fading multiple objects 0 Answers

How to select objects sharing the same material 1 Answer

Material attaching 0 Answers

Spread material over multiple objects or cubes 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