Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

PhysicMaterial.frictionDirection2

Switch to Manual
public var frictionDirection2: Vector3;

Description

The direction of anisotropy. Anisotropic friction is enabled if the vector is not zero.

DynamicFriction2 and staticFriction2 will be applied along frictionDirection2. The direction of anisotropy is relative to the colliders local coordinate system.

var coll: Collider;

function Start() { coll = GetComponent.<Collider>(); // Make the collider slippery when going forward but not when going sideways. coll.material.frictionDirection2 = Vector3.forward; coll.material.dynamicFriction2 = 0; coll.material.dynamicFriction = 1; }