Examples

// Check if the game is running in the editor
if (Game.IsEditor)
{
    // Perform editor-specific logic
}
// Take a screenshot
Game.TakeScreenshot();

data_object Static Properties 21

ActiveScene
Scene
The current scene that is being played.
AppId
UInt64
Steam AppId of S&box.
CheatsEnabled
bool
This has to be in Game.dll so the codegen will get generated for it
Cookies
CookieContainer
Allows access to the cookies for the current game. The cookies are used to store persistent data across game sessions, such as user preferences or session data. Internally the cookies are encoded to JSON and stored in a file on disk.
Ident
string
Returns the current game's ident - ie facepunch.sandbox
InGame
bool
Return true if we're in a game (ie, not in the main menu)
IsClosing
bool
Set to true when the game is closing
IsEditor
bool
Returns true if the game is running with the editor enabled
IsMainMenuVisible
bool
Returns true if the main menu is visible. Note that this will work serverside too but will only return the state of the host.
IsPaused
bool
Indicates whether the game is currently paused.
IsPlaying
bool
Indicates whether the game is currently running and actively playing a scene.
IsRecordingVideo
bool
True if we're currently recording a video (using the video command, or F6)
IsRunningInVR
bool
Return true if we're running in VR
IsRunningOnHandheld
bool
Return true if we're running on a handheld device (the deck). Will always be false serverside.
Language
LanguageContainer
Lets you get translated phrases from the localization system
PhysicsTrace
PhysicsTraceBuilder
Trace against the physics in the current scene
Random
Random
A shared random that is automatically seeded on tick
SceneTrace
SceneTrace
Trace against the physics and hitboxes in the current scene
Scripting
ScriptSystem
Creates scripts using the current menu or game's exposed types and cached code.
SteamId
SteamId
Your SteamId
TypeLibrary
TypeLibrary
Provides access to the global Sandbox.Internal.TypeLibrary for the current game context. The TypeLibrary is a runtime reflection system that describes types, their members, and relationships in the game and engine assemblies. It allows you to find and create types by name and id. It's basically a sandboxed version of the .net reflection system.
G+
Member
JoinedFeb 2024 Posts78 Score3,325
nice game
Pundyly
Banned
JoinedAug 2022 Posts24 Score3,649
nice gamme
HellDiver Soldier
Member
JoinedFeb 2023 Posts1 Score320
nice game diddy
rydoginator
Member
JoinedMar 2026 Posts1 Score80
nice game
Player
Member
JoinedOct 2024 Posts1 Score175
Can't wait! Support! I hope to use sbox for Steam game publishing one day!
edited 6 months ago#6
f4
Member
JoinedApr 2026 Posts1 Score815
nice game
edited:
accept my PR
dbushatz
Member
JoinedApr 2026 Posts1 Score0
nice game
АМНЯМ🫦
Member
JoinedJul 2022 Posts10 Score7,257
game nice
banana bread
Member
JoinedApr 2026 Posts3 Score1,615
emag ecin
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.