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
-1
Question by oliver-jones · Nov 27, 2010 at 09:47 PM · errorvariablesobject-reference-errornancompareapproximately

Get Some Crazy Errors In Game - Crazy!! (NaN)

Okay, My game so working great! ... Up till now!

All I have done is changed two variables from state var, to just var (damage, and fireRate) - these are parts of the machine gun script in the FPS tutorial, I have just modified it slightly to work on a turret.

To The Point:

Like I said, all I have done is changed these two variable types. Now when I place my turret into a prefab and duplicate it around the map, I get a LOAD of errors, here are a few:

!CompareApproximately(Sqr

transform.rotation assign attempt for "Camera Orbi" is not valid. Input rotation is {NaN, NaN, NaN, NaN}.

transform.rotation.assign attempt for "Enemy0(Clone) is not valid. Input rotation is {NaN, NaN, NaN, NaN}.

Now, even when I'm not playing my game, and I'm just in the editor, I get an error for the scene camera (rotation NaN, NaN) and I can't even use that for editing - even when I change back my variables in my script.

What The Heck Is Going On?

How even these two variables caused such a massive melt down? All these variables do is control the turret firing.

Please Help

--- When I create e completely new project, I still get that scene camera error: ---

transform.rotation assign attempt for 'SceneCamera' is not valid. Input rotation is { NaN, NaN, NaN, NaN }. UnityEditor.WindowLayout:LoadWindowLayout(String)

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

8 Replies

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

Answer by oliver-jones · Nov 27, 2010 at 11:35 PM

Okay ... So that was a retarded bug in Unity. I fixed it though. As much as the errors look as intimidating as they are. After creating many new fresh projects ... reinstalling, downloading rebooting. Nothing -

All I simply did was close the scene window, and now everything works ...

I think someone might want to report this error to Unity?!

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

Answer by _Petroz · Nov 27, 2010 at 11:21 PM

NaN means 'not a number'. The most common way to create a NaN is to divide by zero:

1 / 0 = NaN

The problem is that NaNs propagate very quickly, so any float which is calculated using a NaN becomes a NaN:

1 + NaN = NaN
2 * NaN = NaN

It's not clear whether the NaNs came from your code or not, if you're seeing in the editor it might suggest that something inside Unity has gone wrong. Try to identify which objects have NaNs, delete those objects and recreate them.

Comment
Add comment · Show 1 · 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 oliver-jones · Nov 27, 2010 at 11:30 PM 0
Share

So I've tried creating a new project, and I still get a SceneCamera Error. I've also tried rebooting and reinstalling -- still got the SceneCamera error, which preventing me from using the editor window

avatar image
0

Answer by kilnyy · Oct 19, 2011 at 08:43 AM

I get the same error,too.I just drag the scene window,and then I solve it. It's so crazy!

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

Answer by elbon96 · Nov 27, 2010 at 10:23 PM

I have no idea what you did, and I don't think anyone would know, but I'd suggest re-installing Unity. That should fix the problem.

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

Answer by the1337Wolf · Jan 04, 2015 at 06:55 AM

I know this is an old thread, but I hope to help some. I was using the 2D feature with an animation and for me the problem was that I had a frame on the 0.0 frame of my animation. I just moved it a bit and it fixed everything. 0,o

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
  • 1
  • 2
  • ›

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How i "import" variables? 2 Answers

Transform.rotate returns NAN error. 0 Answers

Error message : You are not allowed to call this function when declaring a variable. 6 Answers

Error: Input position is { NaN, NaN, NaN }. 2 Answers

NaN exception when spawning soldiers 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