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 pdunton · Feb 06, 2014 at 04:29 AM · javascripterror

Confusing Error

I am working on this game, and I keep getting this error, and the "coins" are not deleting themselvs like they should after I get the error. Thanks!

The Error Reads: Actor::updateMassFromShapes: Compute mesh inertia tensor failed for one of the actor's mesh shapes! Please change mesh geometry or supply a tensor manually! UnityEngine.Object:Instantiate(Object, Vector3, Quaternion) CoinCreater:CreateCoin() (at Assets/Resources/Scripts/CoinCreater.js:29)

Ignore the Commented parts on my script, they are for later.

 #pragma strict
 var xpos : float;
 var spawnpoint : Vector3;
 var coin : GameObject;
 var rotation : Quaternion;
 rotation.eulerAngles = new Vector3(0, 0, 0);
 var newCoin :Object;
 
 function Start () {
 InvokeRepeating("CreateCoin", 1, 1);
 }
 
 function Update () {
 Destroy(GameObject.FindWithTag("Coin"),10);
 }
 
 function CreateCoin(){
     xpos = Random.Range(-50.0,50.0);
     spawnpoint = new Vector3(xpos, 80, 0);
     
     var myColor : Color;                       // This is just working for another part of my script, Please Ignore.
     var mode : boolean = Random.value > 0.5f;
     var rand : float = Random.value;
     var index : int = Random.Range( 0, 3 ); 
     myColor[index] = rand;
     myColor[( index + ( mode ? 1 : 2 ) ) % 3] = 1;
     myColor[( index + ( mode ? 2 : 1 ) ) % 3] = 0;
     
     newCoin = Instantiate(coin, spawnpoint, rotation);
     //newCoin = newCoin as GameObject; 
     
 }
 
 
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

1 Reply

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

Answer by RyanZimmerman87 · Feb 06, 2014 at 04:40 AM

Well you could try to replace:

newCoin = Instantiate(coin, spawnpoint, rotation);

with:

newCoin = Instantiate(coin, spawnpoint, Quaternion.identity);

That's a pretty strange error you're getting so I would try that first.

Also this logic looks a little strange to me. You are checking to destroy the coins every Update() but with a 10 second delay? Yet you are only creating coins every second?

I guess I don't really understand what you are trying to accomplish here on first glance.

I'm not 100% sure but you might be selecting the same coin every time and resetting the destroy time to 10 seconds so it never gets destroyed? Perhaps Destroy() assigns a unique property to that specific gameObject and the newest property overwrites the old one. Never really thought about this before or tried to test how it works but maybe you are just constantly telling it to destroy in 10 seconds so it never gets there?

That's a lot of guessing but I hope that I somehow help.

Edit: found some info on that error:

http://answers.unity3d.com/questions/14497/actorupdatemassfromshape-error.html

Sounds like you should try to use a box collider instead of plane collider or maybe remove a rigid body. You can check it out I just skimmed through it.

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 pdunton · Feb 06, 2014 at 04:48 AM 0
Share

Hey, for some reason I cannot comment.... So this is a comment. Ill try to look up how to fix it but it just keeps saying 10 Characters needed even though I type >10.

But you're right! I changed the mesh and collider to a cube with a width of 0.1 and it doesnt give me that error any more! Thanks!

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

19 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

Related Questions

How to solve error transform.position assign attempt for 'Car' is not valid. Input position is { NaN, NaN, NaN }. 1 Answer

BCE0005: Unknown identifier: 'spriteRenderer'. 2 Answers

Unity freezes when I add a special script 1 Answer

It is not possible to invoke an expression of type 'UnityEngine.GameObject'? 1 Answer

Help with the code 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