
描述
GravityCore is a runtime C++ plugin (with full Blueprint support) for Unreal Engine 5 that adds shape-based custom gravity - planets, ring worlds, and directional cuboid zones - that actually works in multiplayer. Define a gravity volume (Sphere, Cylinder, or Box), give it a direction and a strength, and any character inside is pulled correctly, stands on the surface, and walks, jumps and falls in that gravity. It drives the engine's built-in variable gravity, so it works with the Character Movement Component instead of fighting it.
The hard part - multiplayer - is built in. Gravity is computed deterministically from position on every machine, so other players' characters stay surface-aligned and smooth: no proxy jitter, no tilt, no walk/fall animation flicker.
Preview v1.0 | V1.1 Zero Gravity & Jetpack | Playable Demo | Documentation | Discord Community
How to Use GravityCore
New in V1.2: per-source gravity strength (tune each planet's pull, from moon-light to super-earth) and a built-in first-person / third-person toggle on the demo character.
Drop a GravitySourceActor into your level, pick a shape, and base your character on the included BP_GravityCharacter (or reparent to AGravityCharacter). Add your own walkable mesh and play.
Includes a ready-to-use gravity character with an independent, gravity-aligned camera in both first and third person.
──────────────────────────────
CORE FEATURES
──────────────────────────────
▸ Shape-Driven Gravity Volumes - one component, a Shape dropdown: Sphere, Cylinder, or Box. Each is a self-contained SceneComponent with its own transform, so you can place, rotate, attach, or stack as many as you like.
▸ Planet Gravity - Sphere pulls toward the center. Walk all the way around a planet, moon, or asteroid.
▸ Ring-World Gravity - Cylinder pushes radially outward from its axis (centrifugal). Walk the inside of a ring or O'Neill cylinder; the axis follows the component's local Z, so orient it any way.
▸ Cuboid / Directional Gravity - Box gives uniform gravity straight down its local -Z, for rooms, corridors, or flip-gravity puzzle zones.
▸ Per-Source Gravity Strength (NEW) - each volume has its own gravity strength (cm/s^2), so a moon pulls lightly and a dense planet pulls hard. 980 = Earth. The per-level default has its own strength too; everything defaults to standard gravity (backward-compatible).
▸ First-Person or Third-Person (NEW) - the demo character now toggles between a gravity-aligned first-person camera and the third-person orbit camera at the press of a key. Both stay level to the surface on a planet or ring, with no roll. Each player picks their own view in multiplayer.
▸ Invert Toggle - flip any shape: Sphere repels, Cylinder pulls to the axis, Box pushes up.
▸ Priority Override Zones - nest a small high-priority volume inside a large one; where they overlap, the highest Priority wins. Stack layers and mix shapes - e.g. a flip-gravity Box room inside a Sphere planet field.
▸ Per-Level Default Gravity - a placeable AGravityDefaults actor sets what a character feels OUTSIDE every volume: a global gravity direction (and strength), or zero-gravity (space). No actor = world-down, exactly as before.
▸ Zero-Gravity Free-Fly - outside gravity the character flies in full 6DOF with no floor snapping and never falls, with a dedicated up/down thrust input so space actually feels like space.
▸ Optional Jetpack, Replicated - a toggle input lifts the character into a hover that holds a minimum height above the floor and never falls; up/down thrust rises above it. Predicted + replicated, with an On Jetpack State Changed Blueprint event that fires on every machine.
▸ Multiplayer Replicated - gravity is a deterministic function of position, computed locally on every machine, so simulated proxies align to the surface and move smoothly. No overlap-event drift, no proxy jitter, no false "falling," and floor detection stays correct on proxies (no walk/fall animation flicker).
▸ Built On Engine Variable Gravity - sets the Character Movement Component's gravity direction and strength, so floor detection, stepping, jumping and falling all work in any gravity direction, with full network prediction.
▸ Gravity-Aligned Character & Camera - the included AGravityCharacter has an independent, gravity-aligned camera (first or third person, full 360 yaw, decoupled from the character's facing) and orient-to-movement that turns the character to face its movement on any surface.
▸ Subsystem-Driven Selection - a world subsystem picks the right source per location by point-in-volume + priority. No collision or overlap setup, no triggers to wire.
▸ Editor & Runtime Debug - per-shape boundary gizmo, red gravity-direction arrows, and an optional translucent volume mesh with adjustable color - each independently toggleable. Debug draws compile out of Shipping.
▸ Logical Volumes (No Collision) - the gravity source is the field only, kept independent from geometry, so you use your own walkable meshes (samples included).
▸ Full Blueprint Support - shape, size, strength, invert, priority, the gravity query, the per-level default, the jetpack and the first-person toggle are all exposed to Blueprint and C++.
──────────────────────────────
TECHNICAL HIGHLIGHTS
──────────────────────────────
▸ Full Blueprint support - all source parameters Blueprint read/write; GetGravityDirectionAtLocation(), ContainsPoint(), and the subsystem's ComputeGravityDirection() / GetGravityStrengthAt() / ShouldApplyGravity() callable at runtime
▸ Custom UCharacterMovementComponent that drives the engine's variable gravity - walking / jumping / falling / floor detection in any gravity direction, with network prediction
▸ Per-source gravity strength (cm/s^2) applied through the CMC's gravity scale, recomputed per-position each tick so it stays deterministic across machines like the direction
▸ Deterministic, position-based gravity computed on every machine - correct simulated proxies without replicating rotation or using overlap events
▸ First-/third-person toggle on the demo character - a gravity-aligned first-person camera driven from the same look math as the orbit camera; local per-client, no replication needed
▸ Smooth gravity transitions, translation-only network smoothing, and a movement-mode mirror on proxies to prevent walk/fall flicker
──────────────────────────────
INCLUDED
──────────────────────────────
▸ Full C++ source
▸ GravitySourceActor / BP_GravitySource - drop-in gravity volume (pick the shape, set the strength)
▸ AGravityDefaults - placeable per-level default gravity (direction + strength, or zero-gravity)
▸ BP_GravityCharacter - ready-to-play character with gravity movement, first/third-person camera, and jetpack
▸ Jetpack character variant + demo FX
▸ Mannequin character + Anim Blueprint (with a flying/floating locomotion set)
▸ Enhanced Input mapping context + Move / Look / Jump / Vertical / Jetpack / First-Person actions
▸ Walkable ring/cylinder mesh (SM_Ring) for the ring-world demo
▸ Demo level with a planet, a ring world, and a flip-gravity box, pre-configured
──────────────────────────────
PERFECT FOR
──────────────────────────────
Space games, planetary exploration, ring-world / megastructure settings, sci-fi platformers, gravity-flip puzzle games, jetpack / zero-g traversal, and any multiplayer or single-player project needing custom gravity directions and strengths - without writing gravity-aligned movement, surface rotation, floor detection, or the multiplayer replication math from scratch.
──────────────────────────────
NOTES
──────────────────────────────
▸ The gravity source is a logical volume with no collision - provide your own walkable meshes (samples included).
▸ Built on the engine's built-in variable gravity / per-character gravity direction.
▸ First person is a demo-character view toggle; gravity itself is camera-independent, so any camera rig works.
▸ Supports Unreal Engine 5.4, 5.5, 5.6, 5.7, and 5.8.













