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 Aug 04, 2014 at 03:37 PM by Graham-Dunnett for the following reason:

Duplicate Question - http://answers.unity3d.com/questions/topics/nullreferenceexception.html

avatar image
0
Question by saviour2014 · Aug 04, 2014 at 03:37 PM · nullreferenceexception

Null reference error after detecting collision

I know this particular Nullreference exception question has been asked many many times. so sorry for that.

My problem is after detecting collision even i can use one method from a class i can not use a function from another class both classes are very similar to one another so i dont get why i get "Object reference not set to an instance of an object"

project is working except for that part which is making me go crazy. and i can not create the win conditions.

here is the project files its just 120KB so please let me know what is the mistake i am doing.

https://drive.google.com/file/d/0B_y3N0jciYFSWHBFbG1qZzNLazA/edit?usp=sharing

Thanks in advance.

Error Log:

NullReferenceException: Object reference not set to an instance of an object Goal.GetPoint () (at Assets/SCRIPTS/Goal.cs:11) UnityEngine.Component:SendMessage(String, SendMessageOptions) BALL_MOVEMENT_SCRIPT:OnTriggerEnter(Collider) (at Assets/SCRIPTS/BALL_MOVEMENT_SCRIPT.cs:50)

Comment
Comments Locked · 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 gjf · Aug 04, 2014 at 02:27 PM 0
Share

first of all, this is where people post sections of code with problems, etc. people helping aren't likely to go somewhere to download a whole project (no matter how small).

that said, check that you have added references to all of your other objects that need to communicate with one another.

for example, your Scorekeeper needs to know where the player score display components are.

your goal objects don't have a reference set to the '`Scorekeeper`' either...

if you have a single score manager (named Scorekeeper in your case) it's a good idea to use the Awake()/Start() functions to get a reference to it ins$$anonymous$$d of remember to set it in the Inspector (which you forgot!). if you've only got 2 of them it's not a big deal, but if it were something you had a lot more of, then it's more things to fix/change/etc.

one thing you'll need to do when you fix those things is remember to check the direction for the ball when you restart it... make sure it's headed back to the other player...

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Attached scripts as List? 1 Answer

NullReferenceException script problem? 0 Answers

I'm having more problems accessing a variable from another script in c# 2 Answers

how do I find what causes "NullReferenceException" 2 Answers

NullReferenceException 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