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;
}