I whant a script that find spheres colliders in all the scene and then add to the cloth spheres colliders
I am trying this but I get an error;I am Beginner.
I am trying this script:
private Cloth cloth;
public SphereCollider[] colliders;
void Start()
{
cloth = GetComponent<Cloth>();
colliders = FindObjectsOfType<SphereCollider>();
}
void Update()
{
if (colliders != null)
{
colliders = cloth.sphereColliders; //This line give me an error :(
}
}