menu_bookDocumentation
Your First Project - s&box Documentation
Your First Project
Creating Game Objects
In s&box, everything in your scene is a GameObject. GameObjects can have Components attached to them that provide functionality.
To create a GameObject:
- Right-click in the Hierarchy panel
- Select Create Empty or choose a template
- The GameObject appears in your scene
Creating Components
Components add functionality to GameObjects. To create a Component:
- Select a GameObject in the Hierarchy
- Click Add Component in the Inspector
- Choose a Component type or create a new one
Player Input
Here's a simple example of handling player input in a Component:
CSHARP
public class MyPlayer : Component
{
protected override void OnUpdate()
{
// Check for jump input
if ( Input.Pressed( "Jump" ) )
{
Log.Info( "Jump pressed!" );
}
// Get movement input
var moveInput = Input.AnalogMove;
// Apply movement
WorldPosition += moveInput * Time.Delta * 100f;
}
}Next Steps
- Explore the Engine — Learn more about how s&box works
- Scenes & GameObjects — Deep dive into the scene system
- Code — Learn C# programming in s&box
Was this helpful?