set_world_gravity
Set a precise world gravity value in the Unreal Editor by writing GlobalGravityZ and the override flag, then re-reading GetGravityZ to confirm the effective result.
Instructions
Set an exact global gravity on the EDITOR world's WorldSettings: writes GlobalGravityZ and the "Override World Gravity" flag, then RE-READS GetGravityZ() into the reply so gravity_z is a measurement rather than an echo. Earth is about -980 with the default centimetre unit. Use this when you want a number; use configure_gravity for named presets (Earth/Moon/Mars/Zero). Undoable (wrapped in a transaction) but it dirties the MAP -- save_level to keep it, and check the .umap is not read-only or the save writes nothing.
Returns: { applied_gravity_z: number (what landed in GlobalGravityZ), enable_override: bool, gravity_z: number (re-read GetGravityZ, the effective value), success: bool (hardcoded) }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gravity_z | Yes | Custom gravity along Z in cm/s^2 (negative = downward; Earth is about -980). | |
| enable_override | No | Optional bool (default true). True makes the world use gravity_z; false disables the override so the project default applies again. |