Physics 2D
Aego simulates 2D rigid bodies with its own solver. A body is a node with Rigid Body 2D; colliders on that node and its children give it a shape. Scripts react to contacts and query the world.
Physics runs during Play and in aego run. In edit mode nothing moves, and the Scene View shows collider outlines and their problems.
To try it:
- Create → Physics → Rigid Body gives a falling box.
- Create → Physics → Static Collider gives a floor for it.
- Press Play.
Try it
Change the example parameters and compare the result. Reset restores the initial scene.
Starts the scene; open the example parameters to experiment.
Scene3 nodes
Box
Transform
position[0, -3]rotation0scale[1, 1]
Rigid Body 2D
typeenumdynamicmassModeenumautomassfloat0gravityScalefloat1linearDampingfloat0angularDampingfloat0fixedRotationboolfalsebulletboolfalseallowSleepbooltrueinterpolatebooltruelayerlayer0masklayer mask-1
Floor
Transform
position[0, 4]rotation0scale[1, 1]
Rigid Body 2D
typeenumstaticmassModeenumautomassfloat0gravityScalefloat1linearDampingfloat0angularDampingfloat0fixedRotationboolfalsebulletboolfalseallowSleepbooltrueinterpolateboolfalselayerlayer0masklayer mask-1
- Units and axes Physics works in world units.
- Components These components make a node part of the simulation.
- Bodies and hierarchy A collider belongs to the nearest node at or above it that has a Rigid Body 2D.
- Collision layers Up to 32 named layers and the pairs that collide are declared in
project.aegoor in Project Settings → Physics: - Events Declare a method with one of these names in any script on the body node or on the collider node:
- Scripting Scripts move bodies through the Rigid Body 2D component and ask the world what is where through
aego/physics. - Settings Project Settings → Physics edits the
physicsblock ofproject.aego: gravity, substeps, iterations, contact stiffness, sleep thresholds, layers and the matrix. - Editor tools The editor draws colliders, contacts and forces and lets you shape colliders with handles.
- Lifecycle What happens to bodies, shapes and contact events when the scene changes during Play.
- World The physics world steps all bodies together at the fixed rate, 60 times a second by default, never with the frame time.
- Common mistakes These are the mistakes that most often make physics feel wrong.