🚢
Airship
  • Getting Started
    • Welcome to Airship
    • Installing Airship
  • TypeScript
    • Overview
    • AirshipBehaviour
      • Adding Inspector Properties
      • AirshipSingleton
      • Using Component Decorators
      • Accessing Other Components
  • Publishing
    • Publish Game
    • Developer Console
  • Networking
    • Multiplayer
    • Local Server Mode
    • Network Signals
    • Network Functions
    • Network Identity
    • Network Transform
  • Input
    • User Input
      • Actions
      • Keyboard
      • Mouse
    • Proximity Prompts
  • Core Package
    • What is the Core Package?
    • Chat Commands
    • Inventory
    • Spawning Characters
    • Enable / Disable Core Features
  • Physics
    • Physics Settings
    • Physics Layers
  • Platform Services
    • Data Store
      • Locking
    • Cache Store
    • Leaderboards
    • Platform Inventory
    • Server Management
    • Server List
    • Server Transfers
    • Users
    • Parties
    • Matchmaking
    • External Services
  • CHARACTERS
    • Quick Configuration
    • Character Movement System
      • Character Movement Data
      • Character Movement Events
    • Character Camera
      • First Person Camera
      • Simple Usage
      • Camera Structure
      • Default Camera Modes
      • Disabling the Camera System
    • Character Animations
      • Character Blender Animations
      • Character Ragdoll
  • Accessories
    • Accessories Intro
    • Creating Accessories
    • Using Accessories
  • ANIMATIONS
    • Animation Events
  • Optimization
    • Live Game Profiler
    • Reducing Bundle Size
  • Game Settings
    • Game Visibility
  • Other
    • Project Status
    • FAQ
    • DataType Math
    • JS to Luau
    • Tags
    • Terrain
    • AirshipNetworkBehaviour
      • Lifecycle Events
      • ServerRpc
      • ObserversRpc
      • TargetRpc
    • VoxelWorld
      • Voxel World Getting Started
      • Voxel World Tips
      • Prefab Voxels
      • QuarterBlocks
    • Easy Helper Utils
      • Easy Motion
      • Easy Grid Align
      • Easy Look At
      • Easy Shake
      • Easy Destroy
Powered by GitBook
On this page
  1. Physics

Physics Layers

How to work with Unity Game Object layers in Airship

PreviousPhysics SettingsNextData Store

Last updated 8 months ago

Airship reserves layers 0-16 for internal use. Every other layer is available for use by game devs.

These layers are named GameLayer[0-31] but can be renamed as you see fit.

You may also change the Physics Matrix for these layers. Read more about the

In Typescript you can use the layers via their name or index. You can easily get their index with the GameLayer static Enum.

// Create a mask from layer names
const layerMask = LayerMask.GetMask("GameLayer0", "GameLayer1");

// Check if an object is a game layer
if (this.gameObject.layer === GameLayer.GAMELAYER_0) {

	//Raycast with a game layer mask
	if (Physics.Raycast(this.transform.position, this.transform.forward, 10, layerMask)) {
		print("Hit a game layer object");
	}
	
}

You can revert core layers you have renamed by using the menu button

Airship->Misc->Repair Project

Physics Matrix here.