Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Cloth.selfCollision

Switch to Manual
var selfCollision: bool;
bool selfCollision;
selfCollision as bool

Description

Will the cloth collide with itself?

Enable this only where needed, as it has a big impact on cloth performance.

	GetComponent(InteractiveCloth).selfCollision = false;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        GetComponent<InteractiveCloth>().selfCollision = false;
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		GetComponent[of InteractiveCloth]().selfCollision = false