Legacy Documentation: Version 4.6.2
Language: English
  • C#
  • JS
  • Boo

Script language

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

Cloth.thickness

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public var thickness: float;
public float thickness;
public thickness as float

Description

The thickness of the cloth surface.

This is the distance kept between any cloth vertex and and other collider (or other cloth vertex if self-collision is enabled). Any object closer then this distance will collide with the cloth. If this value is too low, you may see the edges of objects intersecting the cloth surface. If this value is too high, you may see noticable distance between the cloth surface and colliding objects or stiffness in cloth motion if self-collision is enabled. Must be larger then zero.

	transform.GetComponent(Cloth).thickness = 0.2;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        transform.GetComponent<Cloth>().thickness = 0.2F;
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		transform.GetComponent[of Cloth]().thickness = 0.2F