ドキュメント

Unity Engine

Unity Engine

gravityScale

The degree to which this object is affected by gravity.
読み終わるまでの所要時間 1 分最終更新 21日前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.Physics2DModule
public float gravityScale { get; set; }

Remarks

In 2D physics, the gravity is a global setting in the Physics2D class but you can also control the proportion of that gravity applied to each object individually using gravityScale. For example, it may be easier to implement a flying character by turning off its gravity rather than simulating the forces that keep it aloft.
Additional Resources: Physics2D.gravity