- Home /
Question by
unity_weim7HZpxOskbg · Mar 03, 2019 at 08:40 AM ·
c#collidercloth
How to assign sphere colliders in individual pair in the cloth component.
I have a script which spwans and destroys a prefab every second. This prefab has a sphere colider which interacts with a cloth component. Now the rate of spwan is higer than the rate of destroy, therefore there are multiple instances of this prefab at a time on the screen. And each one of them should interact with the cloth. However i cant seem to assign them to the individual pair of elements. How can i do this?
Here a sample of the code im trying:
Cloth a = net.GetComponent<Cloth>();
Collider colliders = GetComponent<SphereCollider>();
a.sphereColliders[ballCount] = colliders;
Comment