October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
VGSources
Blog

How to Make a Simple Game in S&box

Start a first S&box game with an empty Game Project, one GameObject, a C# Component, and a single input-driven change.
WorldS&box Length3 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make a first, playable S&box project, create a Game – Empty project, add a GameObject and a custom C# Component, then connect one input to a visible change such as moving the object. You do not need Hammer or ActionGraph for this beginner route.

Start with a Game Project

Install S&box through Steam and open the editor; the editor and game are part of the same download, according to the official Getting Started documentation and S&box learning page. On the welcome screen, select New Project, then choose Game – Empty, following the Your First Project guide.

Choose a Game Project rather than an Addon Project. A Game Project is the base for a game; an Addon Project adds assets to an existing game project. Project information, including its title and type, is recorded in the .sbproj file. See Project Types.

Build a tiny interaction in the editor

1. Add an object to the scene

A Scene is the world being rendered and updated. Create a GameObject from the scene tree: it is a positioned, rotated, and scaled object, and it can contain child objects that move relative to it. Scenes can be saved and loaded. These building blocks are described in Explore the Engine.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Game Programming Patterns
  • Brand New in box. The product ships with all relevant accessories

2. Attach a custom Component

Select the GameObject, use Add Component in the inspector, and create a custom Component. The first-project guide says this opens the file in Visual Studio. Components add behavior to GameObjects; for example, a ModelRender component renders a model, while a BoxCollider gives an object solidity. For a first exercise, keep the component focused on one behavior rather than adding a full set of game systems.

3. Connect one input to one visible result

Use the official first-project instructions alongside the Input documentation linked from Getting Started to read a key press and change the GameObject’s WorldPosition. Moving a visible object is a simple way to confirm that the input and component are connected. If the camera does not show the movement, the guide describes parenting the camera to the object or setting Scene.Camera.WorldPosition.

Rank #2

The first-project documentation gives the workflow but does not provide a complete sample game’s code. Follow its current API and input examples rather than assuming a code snippet from elsewhere will compile unchanged.

4. Run, observe, and adjust

Run the game to check that the input produces the intended visible change. S&box supports editing scenes and hotloading code changes, so you can adjust the component and inspect the result without making the first project larger than it needs to be. The Getting Started documentation explains this iterative approach.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which S&box tools should a beginner use?

S&box games use C#, while the editor supports a visual workflow for arranging scenes and iterating on them. The right tool depends on what you are building:

Approach Use it when Is it needed for this first project?
C# Component You want to add a small behavior to a GameObject with code. Yes; this is the route in the official first-project guide.
ActionGraph You prefer visual scripting for game logic. No; it is an alternative, not a required step.
Hammer You need to build a map with brushwork, props, lights, or GameObjects. No; use it if your project calls for a hand-built map.

The Editor documentation and Editor Tools documentation describe the additional tools. The available documentation establishes these options, but does not provide a controlled comparison of their ease or performance.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Testing is separate from publishing

You can make and test a simple project in the editor without preparing a standalone release. The Getting Started documentation describes standalone export as being in preview and subject to Valve approval and a Facepunch license. Treat those terms as publishing constraints, not as prerequisites for building your first interaction; check the current official documentation if you plan to distribute a standalone build.

Quick Recap

SaleBestseller No. 1
Game Programming Patterns
Game Programming Patterns
Brand New in box. The product ships with all relevant accessories
$24.95
SaleBestseller No. 2
Designing Games: A Guide to Engineering Experiences
Designing Games: A Guide to Engineering Experiences
Used Book in Good Condition
$34.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Turn On Vibrant Visuals in MinecraftMinecraftBlog3min
  2. Best Multiplayer Games for Low-End PCsBlog4min
  3. Minecraft: How To Use And Install OptiFineBlog5min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.