Attaches a collider
to the cloth object.
// Attach this transform's collider to a cloth, make // it tearable and two way interactive on forces. // REMEMBER: Only has an effect if some vertices of // the cloth are intersecting the collider var cloth : InteractiveCloth; function Start() { if(cloth) cloth.AttachToCollider(transform.collider, true, true); else Debug.LogError("No cloth was assigned in the inspector"); }
using UnityEngine; using System.Collections; public class Example : MonoBehaviour { public InteractiveCloth cloth; void Start() { if (cloth) cloth.AttachToCollider(transform.collider, true, true); else Debug.LogError("No cloth was assigned in the inspector"); } }
import UnityEngine import System.Collections public class Example(MonoBehaviour): public cloth as InteractiveCloth def Start() as void: if cloth: cloth.AttachToCollider(transform.collider, true, true) else: Debug.LogError('No cloth was assigned in the inspector')