hello Everyone
i m newbe in iphone unity and i have try to add rigidbody in runtime of sphere1 here is my code
i have some doubt in script structure between iphone unity and mac unity.
var MyGameMass = gameObject.Find(“Sphere1”).AddComponent(“Rigidbody”);
MyGameMass.rigidbody.mass = 5.0;
But i cant add mass in iphone unity1.7 and i done successfully add rigidbody and mass in normal mac unity
But i cant add in iphone unity1.7
thanks
you can but AddComponents returns an object of class Component, not of class GameObject and as the “lazyness features” of UnityScript don’t work on the iphone, you get a kick there 
so what you would have to do is
var MyGameMass = gameObject.Find("Sphere1");
MyGameMass.AddComponent("Rigidbody ");
MyGameMass.rigidbody.mass = 5.0;
thanks Dreamora
But i cant change rigidbody.mass = 5.0
iphone unity display only one value rigidbody.mass = 1.0
thanks
and where do you check that? I assume at runtime, right? cause above will not impact the editor in any form outside the play mode
yes
you right
BUT i check in file, select object in Hierarchy but display rigidbody mass = 1;
So now i m confused
Pls give me solution
thanks
There appears to be a bug in iPhone 1.7 that sometimes stops the mass from being changed in a script but it was not reproducible in 3.0 (it was actually a bug in the version of Unity that Unity iPhone was branched from). You should move to Unity 3.0 if possible. Failing that, you may be able to create an empty object with a rigidbody and put it in a prefab with the mass set to 5.0. Then, you could parent your existing object to an instance of the prefab to get the physics.