Skip to main content

Collisions


Brakeza3D provides flexible collision modes and shapes, allowing developers to detect collisions, respond to physical interactions, and apply custom gameplay logic through LUA scripts.

All object instances can participate in the collision system, supporting ghost, rigid body, and kinematic behaviors depending on the configured mode.

From the menu, you can configure fundamental aspects such as gravity strength and various performance settings:

Menu collisions

Collision Modes


ModePhysics ReactionTypical Uses
GhostNo physical responseTriggers, sensors, detection zones
RigidBodyReacts to forces, collisions, gravityRealistic physics objects, falling items
KinematicControlled by code, not physicsPlayer characters, moving platforms

Ghost Mode

Detects collisions but is not affected by them. Ideal for trigger zones that activate events when the player enters.

RigidBody Mode

Fully simulated physics object. Can be set as static (mass = 0) for immovable obstacles. This is the only mode allowed for non-convex geometries (triangle mesh).

Kinematic Mode

Movement is controlled manually via code methods. The physics engine handles collision detection but not movement forces. Perfect for player characters that need precise control.

Collider Shapes


ShapePerformanceTypical Uses
Simple ShapeExcellentGeneral-purpose objects, boxes, spheres
Capsule ShapeGoodCharacters, tall or rounded objects
Triangle MeshLowerStatic meshes requiring precise collisions
  • Simple Shape: Basic convex hull, fastest performance
  • Capsule Shape: Pill-shaped collider, great for characters
  • Triangle Mesh: Matches exact geometry, use only when precision is critical

Collider shapes can be configured either through the GUI or via LUA scripts.

Debug Collisions


You can debug the collision system both visually and through system logs:

  • Visual debugging: Display collision shapes and boundaries directly in the scene
  • System logs: Runtime information about collision events and interactions

This helps identify incorrect alignments, unexpected intersections, and fine-tune collision behavior.

Debug collisions

Scripting API


For programming collisions via LUA scripts, see the Collision System API reference, which includes:

  • Setting up colliders (setupGhostCollider, SetupRigidBodyCollider)
  • Applying forces and impulses
  • Kinematic movement methods
  • Collision callbacks (onCollision)
  • Bone mapping for animated models