Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

Collider.material

Switch to Manual
public var material: PhysicMaterial;

Description

The material used by the collider.

If material is shared by colliders, it will duplicate the material and assign it to the collider.

// Expose properties in the inspector for easy adjustment.
var dynFriction: float;
var statFriction: float;

var coll: Collider;

function Start() { coll = GetComponent.<Collider>(); coll.material.dynamicFriction = dynFriction; coll.material.staticFriction = statFriction; }