ドキュメント

Unity Engine

Unity Engine

gravity

The gravity applied to all rigid bodies in the Scene.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public static Vector3 gravity { get; set; }

Remarks

Gravity can be turned off for an individual rigidbody using its Rigidbody.useGravity property.
using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{ void Example() { Physics.gravity = new Vector3(0, -1.0F, 0); }}
gravityModifiers is Obsolete.