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 indra p · May 21, 2014 at 01:43 PM · errorprojectapply

NullReferenceException: Object reference not set to an instance of an object BotControlScript.Start () (at Assets/script/BotControlScript.cs:41)

i douwnloaded a sample project somewhere and used the script to my own project everything seem fine but i got this error message :

NullReferenceException: Object reference not set to an instance of an object BotControlScript.Start () (at Assets/script/BotControlScript.cs:41)

and also after i build it ,the camera is not working. it not following the player as how its work in the preview...

here is my project file : https://www.dropbox.com/s/oanyfvnpgw1lj4q/gumbla.rar the scene located in "asset" folder

could someone find a way how to fix it?

thank you

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 Sprawl · May 21, 2014 at 01:46 PM 0
Share

I suggest you post the part of the script you're having an issue with ins$$anonymous$$d of the whole script. It's quite painful to naviguate through a whole code while the issue it probably just a not initiated variable.

Your camera is probably not working because of the error too.

Also, be sure that if the script you downloaded needed you to assign a gameObject in editor, you didnt forget to do it.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Landern · May 21, 2014 at 01:47 PM

In the script BotControlScript.cs, line 41, you're trying to get a reference to a transform that belongs to an gameobject named "Enemy". Your scene does not contain such an object, so it can't find the GameObject and of course because it can't find that, the property transform doesn't exist... hence the null reference exception. Add an enemy, read up on GameObject.Find and fix your scripts expectations.

Comment
Add comment · Show 3 · 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 indra p · May 21, 2014 at 02:56 PM 0
Share

thanks.. i added an blank object then named it enemy..now the error messase is gone...but the camera still not working when i build the game...its not following the player..any solution?

avatar image Landern · May 21, 2014 at 03:17 PM 0
Share

It follows the girl in the bikini on $$anonymous$$e, this is from your project download, i have no idea why it wouldn't work for you unless you modified something and what was uploaded to dropbox differs.

avatar image indra p · May 21, 2014 at 04:44 PM 0
Share

Its weird..Did you build it?..I mean build to exe files..the camera work when I played it in unity.. But not after I run the exe..

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

22 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

Related Questions

"The associated script cannot be loaded" on every Script in every GameObject in the project. Corrupted Project. 15 Answers

To "Apply" to the project by using a script? 1 Answer

Scripting Errors I cannot fix, Could use a helping hand and someone to tell me how to fix it. 2 Answers

Vehicle Script Help 1 Answer

Error transfering my project to Unity 4.0 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