PhysicMaterial.frictionDirection2 摩擦力方向

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.

dynamicFriction2和staticFriction2将沿着frictionDirection2被应用。各向异性(有向性)方向相对于碰撞器的自身坐标系统。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void Awake() {
		collider.physicMaterial.frictionDirection2 = Vector3.forward;
		collider.physicMaterial.dynamicFriction2 = 0;
		collider.physicMaterial.dynamicFriction = 1;
	}
}
// Make the collider slippery when going forward but not when going sideways
//使碰撞向前滑动而不是侧滑

collider.physicMaterial.frictionDirection2 = Vector3.forward;
collider.physicMaterial.dynamicFriction2 = 0;
collider.physicMaterial.dynamicFriction = 1;
Page last updated: 2011-3-31