Crate ambient_api

source ·
Expand description

The Ambient Rust API

Welcome to the Ambient Rust API! This API allows you to write logic for Ambient, the multiplayer game engine, in Rust.

The Ambient Book can be found here.

Ambient has first-class support for Rust. Please report any issues you encounter to the repository.



  • Retrieval of assets and where to find them.
  • [Client-only] Audio functionality, including loading sounds and playback.
  • [Client-only] Helper functions for the camera.
  • Auto-generated component definitions. These come from ambient.toml in the root of the project.
  • Auto-generated concept definitions. Concepts are collections of components that describe some form of gameplay concept.
  • ECS-related functionality not directly related to entities.
  • Manipulation, creation, removal, search and more for entities.
  • Global functions and types for your convenience.
  • [Client-only] Input retrieval and manipulation.
  • Messaging to other modules and to the other side of the networking.
  • Auto-generated message definitions. Messages are used to communicate with the runtime, the other side of the network, and with other modules.
  • [Server-only] Physics-related functionality, including applying forces, changing physical properties, and more.
  • Player-specific functionality.
  • [Client-only] Window-specific functionality.

Attribute Macros

  • Makes your main() function accessible to the WASM host, and generates components and concept modules for your project.