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