Version: 5.5 (switch to 5.6b)
LanguageEnglish
  • C#
  • JS

Script language

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

Removed in version 5.5.0p1

PhysicMaterial.frictionDirection2

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

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> 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
Obsolete public var frictionDirection2: Vector3;
Obsolete public Vector3 frictionDirection2;

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; }
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Collider coll; void Start() { coll = GetComponent<Collider>(); coll.material.frictionDirection2 = Vector3.forward; coll.material.dynamicFriction2 = 0; coll.material.dynamicFriction = 1; } }