- Home /
Question by
daco2000 · Jan 20, 2015 at 02:43 AM ·
javascriptrigidbody2d
Problem applying rigidibody2d via Javascript
Hi everyone, I'm trying to add the Rigidbody2D to a set of gmeobject with a defined tag. The tag works fine and the go.transform.position as the go names are good but the rigidbody2D doesn't apply. Does anyone knows why. Thank You! Daniele
var gos : GameObject[];
gos = GameObject.FindGameObjectsWithTag("scelta");
for (var go in gos){
print(go);
print(go.transform.position);
var rb : Rigidbody2D = go.gameObject.AddComponent(Rigidbody2D);
}
Comment
Your answer

Follow this Question
Related Questions
Not understanding how rigidbody2D.AddForce works 0 Answers
How to assign Rigidbody2d to a player using Javascript 1 Answer
Portions of code don't work in Monodevelop 1 Answer
Rigidbody2D getting destroyed in the inspector 2 Answers
How to set .isKinematic=false; on object in a script that is not attached to the object 1 Answer