- Home /
How can you copy all of the colliders in a scene
We are using two plugins for our game Uni2d and Liquid Physics 2d. However, Liquid Physics 2d uses its own physics simulation and thus doesn't collide or interact with objects using Unity's built in physics (which Uni2d does). A workaround was suggested that we create a script that identifies all of the Unity physics colliders, copies them as liquid physics colliders and then deletes Unity colliders. Does anyone know how to accomplish this? Any hint in the right direction would be greatly appreciated.
Answer by skylem · Jan 19, 2015 at 01:07 PM
you could use findobjects of type and a foreach loop to do something with each collider
Transform sList = FindGameObjectsOfType<SphereCollider>();
foreach(SphereCollider sc in sList) {
// create your other physics colliders
// sc references the object u will want to copy
// and then remove it here.
}
Your answer
Follow this Question
Related Questions
Unity APP didn't load on the Chrome browser,Unite didn't load on the Chrome 0 Answers
Scale fishing rod in one direction 2 Answers
Unity2D resize the sprite 0 Answers
Collision 2d is not working perfectly 0 Answers