Table of Contents

Create Project

Command line and Visual Studio Code

The steps below show how to create a new Stride project using the command line. If you prefer Visual Studio Code, run the same commands from its integrated terminal. For the shortest possible start - one .cs file, no project file at all - see Create a File-Based App.

Note

Match the toolkit version to your Stride version - the table is in Getting Started. --prerelease takes the newest preview, so on an older Stride pin it, for example --version 1.0.0-preview.62 for Stride 4.3.

  1. Prerequisites: Make sure all prerequisites are installed. See Getting started for details.
  2. Create a console app. You can follow the official Microsoft tutorial or run:
    dotnet new console --framework net10.0 --name YourProjectName
    
  3. Navigate to the project folder:
    cd YourProjectName
    
  4. Add the toolkit package. It brings in the Stride packages and the asset compiler build step:
    dotnet add package Stride.CommunityToolkit --prerelease
    
  5. Add the Bepu physics package:
    dotnet add package Stride.CommunityToolkit.Bepu --prerelease
    
  6. Update Program.cs: Paste the example code below into your Program.cs file.
  7. Build (optional): dotnet run performs an implicit build, but you can build explicitly:
    dotnet build
    
  8. Run the project:
    dotnet run
    

Visual Studio 2026 and JetBrains Rider

  1. Create a C# Console Application targeting .NET 10.
  2. Add the Stride.CommunityToolkit NuGet package (pre-release). This pulls in the required Stride packages and the asset compiler.
  3. Add the Stride.CommunityToolkit.Bepu package (pre-release) to include the Bepu physics integration.
  4. Update Program.cs: Paste the example code below.
  5. Run the project using your IDE.

Example code

using Stride.CommunityToolkit.Bepu;
using Stride.CommunityToolkit.Engine;
using Stride.CommunityToolkit.Rendering.ProceduralModels;
using Stride.Core.Mathematics;
using Stride.Engine;

using var game = new Game();

game.Run(new SceneSetup3D().UseBepu(), start: Start);

void Start(Scene rootScene)
{
    var entity = game.CreatePrimitive(Primitive3D.Capsule());

    entity.Transform.Position = new Vector3(0, 8, 0);

    entity.Scene = rootScene;
}
  • using var game = new Game(); creates a new Game instance.
  • game.Run(new SceneSetup3D().UseBepu(), start: Start); sets up a basic 3D scene (camera, lighting, sky, ground) with Bepu physics, starts the game and calls Start when the scene is ready. Every piece of the setup is a property; see Scene Setup.
  • void Start(Scene rootScene) is invoked on start with the active root scene.
  • game.CreatePrimitive(Primitive3D.Capsule()) creates a capsule primitive. Primitive3D.Capsule(radius, length) sizes it.
  • entity.Transform.Position = new Vector3(0, 8, 0); places the capsule 8 units above the ground.
  • entity.Scene = rootScene; adds the entity to the scene so it is rendered and simulated. Without it the entity does not appear.

With UseBepu() on the setup, CreatePrimitive() gives the capsule a rigid body, so it falls to the ground.

Create Project - Engine Only builds a ground, a cube and a camera against the engine alone, with no toolkit package, and maps each part to the helper it replaces.

Tip

Remove entities you no longer need to free resources and avoid unnecessary physics updates.

image

Additional examples

Browse more examples in the navigation on the left, grouped by language and complexity.