ドキュメント

Unity Engine

Unity Engine

material

The material used by the collider.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public PhysicsMaterial material { get; set; }

Remarks

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

Examples

using UnityEngine;public class Example : MonoBehaviour{ // Expose properties in the inspector for easy adjustment. float dynFriction; float statFriction; Collider coll; void Start() { coll = GetComponent<Collider>(); coll.material.dynamicFriction = dynFriction; coll.material.staticFriction = statFriction; }}