RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking

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 Extensionsgameplay

Force Field

Applies a gravitational planet effect around the player vehicle, pushing or pulling other vehicles. Toggled via radial menu. Disabled automatically during career mode.

Applies a gravitational planet effect around the player vehicle, pushing or pulling other vehicles. Toggled via radial menu. Disabled automatically during career mode.


Public API

FunctionSignatureReturnsDescription
M.activate()nilEnables the force field; shows UI message with mode (attraction/repulsion)
M.deactivate(silent?)nilDisables force field; clears all vehicle planets; shows message unless silent
M.toggleActive()nilToggles between active/inactive
M.isActive()booleanReturns current state
M.setForceMultiplier(factor)nilSets force direction/strength (positive=repulsion, negative=attraction)
M.getForceMultiplier()numberReturns current multiplier
M.onCareerActive(enabled)-Callback for CareerActive event
M.onClientEndMission()-Callback for ClientEndMission event
M.onDeserialized()-Callback for Deserialized event
M.onSerialize()-Callback for Serialize event
M.onUpdate(dtReal, dtSim, dtRaw)-Callback for Update event
M.onVehicleSwitched()-Callback for VehicleSwitched event

Hooks

HookDescription
onUpdateSends planet commands to all non-player vehicles every 0.05s
onClientEndMissionDeactivates on mission end
onVehicleSwitchedDeactivates on vehicle switch
onSerializeDeactivates before serialize
onCareerActiveDeactivates when career enables

Internals

Planet Physics

Uses obj:setPlanets({x, y, z, radius, mass}) vlua command. The planet is centered on the player vehicle's OBB center with:

  • planetRadius = 5
  • mass = -60000000000000 (base, scaled by vehicle size and multiplier)
  • vehicleSizeFactor = longestBBHalfExtent / 3

Update Throttling

Only sends planet commands every 0.05s (20Hz) to reduce overhead. Iterates all be objects except the player vehicle.

Force Direction

  • forceMultiplier > 0 → repulsion (default=1)
  • forceMultiplier < 0 → attraction
  • UI message reflects mode via translation keys

How It Works

  1. Player activates via radial menu → activate()
  2. Every 0.05s, computes planet position from player OBB center
  3. Sends obj:setPlanets(...) to every other vehicle
  4. On deactivate, sends empty planets obj:setPlanets({}) to all vehicles

Usage Example

-- Toggle from radial menu
gameplay_forceField.toggleActive()

-- Switch to attraction mode
gameplay_forceField.setForceMultiplier(-1)
gameplay_forceField.activate()

See Also

  • Gameplay Achievement - Related reference
  • Gameplay City - Related reference
  • discover - Discover / Experience System - Related reference
  • Gameplay Systems Guide - Guide

Discover

Reference for `gameplay_discover`, the main entry point for the "Discover" experience system. Loads curated gameplay experiences (freeroam scenarios and missions) from Lua modules, presents them as pa

Garage Mode

Manages the garage environment for vehicle inspection/customization. Handles camera orbit setup, vehicle freezing, ceiling/pillar auto-hide, lighting groups, input blocking, and garage-to-test-drive t

On this page

Public APIHooksInternalsPlanet PhysicsUpdate ThrottlingForce DirectionHow It WorksUsage ExampleSee Also