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.



  • Animation functions
  • Retrieval of assets and where to find them.
  • audioclient
    [Client-only] Audio functionality, including loading sounds and playback.
  • Helper functions for the camera.
  • clipboardclient
    [Client-only] Manipulating the operating system’s clipboard.
  • ECS-related functionality not directly related to entities.
  • Manipulation, creation, removal, search and more for entities.
  • Global functions and types for your convenience.
  • httpserver
    [Server-only] HTTP-related functionality, including sending requests and receiving responses.
  • inputclient
    [Client-only] Input retrieval and manipulation.
  • materialclient
    [Client-only] Procedural material generation.
  • meshclient
    [Client-only] Procedural mesh generation.
  • Messaging to other packages and to the other side of the network boundary.
  • Package-related functionality.
  • physicsserver
    [Server-only] Physics-related functionality, including applying forces, changing physical properties, and more.
  • Player-specific functionality.
  • samplerclient
    [Client-only] Procedural sampler generation.
  • textureclient
    [Client-only] Procedural texture generation.
  • windowclient
    [Client-only] Window-specific functionality.

Attribute Macros

  • Makes your main() function accessible to the WASM host, and generates a packages module that contain all packages visible to your package, including itself.