seblague/spherical-gravity — explained in plain English
Analysis updated 2026-08-07 · repo last pushed 2022-06-20
Build a platformer where characters walk on tiny round planets without falling off.
Create a space exploration game where astronauts walk on asteroid surfaces.
Prototype a Mario Galaxy-style level with characters strolling around a small globe.
Add spherical gravity to any Unity game with curved terrain instead of flat floors.
| seblague/spherical-gravity | nextweb4/alias-cockpit | lupul64348/nte-cheat | |
|---|---|---|---|
| Stars | 170 | 162 | 158 |
| Language | C# | C# | C# |
| Last pushed | 2022-06-20 | — | — |
| Maintenance | Dormant | — | — |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | general | general |
Figures from each repo's GitHub metadata at analysis time.
Requires Unity 5 or later, you need to tag planets as "Planet" and set up a ground layer for surface detection.
Spherical Gravity is a Unity code package that lets game developers add realistic gravity to spherical planets. Instead of characters being pulled "down" toward a flat floor, they are pulled toward the center of a round planet, so they can walk all the way around it. This is the effect you see in games like Super Mario Galaxy, where a character can stroll over the surface of a small world and never fall off, because the gravity always points toward the planet's core. The code works by attaching a script called "GravityAttractor" to any planet object in your Unity scene. That script does the math to figure out which direction is "down" for any character standing on the sphere, based on where they are relative to the planet's center. A separate character controller reads that information and continually rotates the player so their feet stay planted on the ground, no matter which part of the globe they are standing on. You also tag the planet as "Planet" and set up a ground layer so the system knows what counts as solid surface for grounding checks. This is aimed at Unity game makers who want to build levels around planets, moons, or small floating worlds rather than traditional flat terrain. For example, if you are prototyping a space exploration game where astronauts walk on asteroids, or a platformer set on tiny round planets, this handles the tricky physics so your characters behave convincingly on curved surfaces. The project comes from a YouTube tutorial, and the code is fairly minimal and instructional rather than a full-featured framework. It has been updated for Unity 5, so developers using that version or later can drop it into a project and follow along with the video. The README doesn't go into detail beyond the basic setup steps, so you'll likely want to watch the tutorial for the full picture.
A Unity code package that makes characters walk around spherical planets instead of flat floors, pulling them toward the planet's center like in Super Mario Galaxy. Drop it into your game to handle curved-surface gravity.
Mainly C#. The stack also includes Unity, C#.
Dormant — no commits in 2+ years (last push 2022-06-20).
No license information is provided in the README, so usage rights are unclear and you should contact the author before using this in a project.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.