Categories
How to connect all child objects with a Fixed Joint component?
I have a Car object that has n Detail children. How can I add a Fixed Joint to each of these objects, which will be connected to the rest?
Answer the question
In order to leave comments, you need to log in
private void JoinChildrens() { var rig = GetComponent(); for(int i = 0; i < transform.childCount; i++) { var fix = transform.GetChild(i).gameObject.AddComponent(); fix.connectedBody = rig; } }
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question