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 /
  • Help Room /
avatar image
0
Question by Esvan_arts · Oct 07, 2016 at 09:36 PM · unity5nullreferenceexceptiontutorialsnull reference exception

NullReferenceException after save the Scene and Project

ENGLISH

Hello everyone, I have a problem after completing the tutorial Six on "Player Health" on Survival Shooter Tutorial.

First of all, i'm using git for the project and it helps me so much. In the project all is good before completing the tutorial n°6, i mean the enemy follows the player and i watch his HUD for the life.

When i put the scripts "PlayerHealth.cs" to player and "EnemyAttack.cs" to zombunny all it's fine, the enemy can attack the player and this dies. Good!, here is no problem.

Here it's the problem: When I save the Scene and the project. Then i close Unity and everything about it like Visual Studio (if it's open), then I open Unity and then i press Play/Run Button in the project and finally the Error: This time the enemy isn't following and/or attacking the player, it moves to a place in the environment.

Unity error: NullReferenceException: Object reference not set to an instance of an object EnemyAttack.Update () (at Assets/Scripts/Enemy/EnemyAttack.cs:54)

first I thought: Maybe is something about git but i was wrong. Is something in Unity but i don't know what it is.

I'm worried because i don't want to have this problem in other project or personal projects. I hope you have a solution. Many thanks.

Esvan.

Information about my PC.

SO: Windows 8.1 Pro 64 bits.

Unity: 5.4.1f1 personal.



SPANISH

Hola a todos, tengo un problema luego de completar el tutorial 6 en “Player Health” en el tutorial del Survival Shooter Tutorial.

Primero que todo, estoy usando git para el proyecto y me ayuda mucho. En el proyecto todo esta bien antes de completar el tutorial n°6, quiero decir que el enemigo sigue al jugador y puedo ver el HUD para la vida.

Cuando pongo el script “PlayerHealth.cs” al jugador y “EnemyAttack.cs” al zombunny todo esta bien, el enemigo puede atacar al jugador y este muere. Bien!, aquí no hay problema.

Aquí esta el problema: Cuando grabo el Scene y el Project. Luego cierro Unity y todo acerca de ello como Visual Studio (si estuviera abierto), luego abro Unity y presiono el botón Play/Run en el proyecto y finalmente el Error: Esta vez el enemigo no sigue y/o ataca al jugador, este se mueve a un lugar en el entorno.

Error Unity: NullReferenceException: Object reference not set to an instance of an object EnemyAttack.Update () (at Assets/Scripts/Enemy/EnemyAttack.cs:54)

Primero pensé: Seguramente es algo acerca de git pero estaba equivocado. Es algo en Unity pero no se que puede ser.

Estoy preocupado porque no quiero tener este problema en otro proyecto o proyectos personales. Espero tengan una solución. Muchas Gracias.

Esvan

información de mi PC.

SO: Windows 8.1 Pro 64 bits.

Unity: 5.4.1f1 personal.

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

0 Replies

· Add your reply
  • Sort: 

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

83 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

NullReferenceException while raycasting? 0 Answers

Null Reference Exception anytime scene is reloaded? 1 Answer

CAR ENTER EXIT 1 Answer

Why am I getting a null reference error? 1 Answer

How can I fix a null pointer exception? (2d platformer tutorial) 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