RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Flowgraph Base ModuleFlowgraph Base NodeFlowgraph Base State NodeFlowgraph Node BuilderFlowgraph GraphFlowgraph Group HelperFlowgraph LinkFlowgraph ManagerNew Node TemplateFlowgraph PinFlowgraph States ManagerFlowgraph UtilsFlowgraph Variable Storage
Directional GravityGet Cloud by IDGet FogGet GravityGet PauseGet PhotomodeGet ScatterSkyGet Time of DayPause GamePlanetRandom Time of DayBullet TimeSet Cloud by ID NodeSet Fog NodeSet Gravity NodeSet ScatterSky NodeSet Time of Day NodeSet Wind NodeSimple Planet Node

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsflowgraphnodesenvironment

Planet

- **File:** `extensions/flowgraph/nodes/environment/planet.lua`

Overview

  • File: extensions/flowgraph/nodes/environment/planet.lua
  • Name: Planet
  • Category: once_p_duration
  • Description: Creates a planet with custom gravity and optional heightmap-based terrain mesh for a vehicle.

Pin Schema

Input Pins

NameTypeDescription
vehIdnumberID of the vehicle that will have modified gravity. Falls back to player vehicle.
positionvec3Position to spawn the planet.
heightmapstringPath to a PNG heightmap file for the planet surface.
surfaceHeightnumberSurface height multiplier for the planet terrain.
radiusnumberRadius of the planet.
massnumberMass of the planet.

Output Pins

None.

Behavior

  • workOnce(): Validates inputs (position, radius ≥ 1, mass required). Sends obj:setPlanets() command to the vehicle with position, radius, and mass. Then generates a 3D spherical terrain mesh from the heightmap PNG using cube-to-sphere projection, placing six ProceduralMesh faces (up/down/front/back/left/right).
  • _executionStopped() / onNodeReset(): Clears planets from the vehicle and deletes all generated ProceduralMesh objects.

Terrain Generation

  1. Loads a PNG heightmap via GBitmap.
  2. Interprets RGB as height values.
  3. Maps six cube faces onto a sphere using warpSphereCubic().
  4. Creates ProceduralMesh objects with computed vertices, normals, UVs, and faces.
  5. Uses procheightmapMat material (dirt texture).

Legacy Pin Mapping

  • vehID → vehId

Node Display

  • Shows debug sphere at planet position, gravity force, and distance to vehicle when showDebug is enabled.
  • Displays computed surface gravity value.

Tags

#flowgraph #node #ge #environment #planet #gravity #terrain


Additional Exports

init()

drawMiddle(builder, style)

  • builder - any
  • style - any

createheightmapMesh(heightmap, uvScale, material)

  • heightmap - any
  • uvScale - any
  • material - any
  • Returns: any

normalFromPoints(p1, p3, p2)

  • p1 - any
  • p3 - any
  • p2 - any
  • Returns: any

placeObject(name, mesh, pos, rot)

  • name - any
  • mesh - any
  • pos - any
  • rot - any
  • Returns: any

heightmapFromPNG(path, scale, invertColors)

  • path - any
  • scale - any
  • invertColors - any
  • Returns: any

getSquare(grid, size, identifier, dimensions)

  • grid - any

  • size - any

  • identifier - any

  • dimensions - any

  • name - string - (see source)

  • color - any - (see source)

  • icon - any - (see source)

  • description - string - (see source)

  • category - string - (see source)

  • todo - string - (see source)

  • pinSchema - table - (see source)

  • legacyPins - table - (see source)

  • tags - table - (see source)

  • gConst - any - (see source)


See Also

  • Directional Gravity - Related reference
  • Get Cloud by ID - Related reference
  • Get Fog - Related reference
  • FlowGraph Guide - Guide

Pause Game

- **File:** `extensions/flowgraph/nodes/environment/pauseGame.lua`

Random Time of Day

- **File:** `extensions/flowgraph/nodes/environment/randomTimeOfDay.lua`

On this page

OverviewPin SchemaInput PinsOutput PinsBehaviorTerrain GenerationLegacy Pin MappingNode DisplayTagsAdditional Exportsinit()drawMiddle(builder, style)createheightmapMesh(heightmap, uvScale, material)normalFromPoints(p1, p3, p2)placeObject(name, mesh, pos, rot)heightmapFromPNG(path, scale, invertColors)getSquare(grid, size, identifier, dimensions)See Also