Skip to main content
Before starting this tutorial, read Working with Data to understand Groups, Resource Types, and Prototypes.
Gravity Spawner is a MonoBehaviour stamper tool that places objects by spawning them above the target surface and running a physics simulation. Each object falls under gravity, settles where it lands, and is then frozen in place. This is useful for rocks, debris, fallen props, or any object that should feel physically placed rather than directly stamped.

Step 1 — Add a Gravity Spawner to your scene

Go to GameObject > MegaWorld > Add Gravity Spawner. A Gravity Spawner component is added to a new GameObject in your Hierarchy. Its Transform scale defaults to (500, 500, 500), which sets the initial stamper area size.

Step 2 — Add a Group with prototypes

Select the Gravity Spawner in the Hierarchy. In the MegaWorld Window, click Add Type to create a new Group. Inside the Group, click Add Resource and choose Unity/GameObject or Terrain Object as the resource type. Drag your Prefabs into the prototype list.
Prefabs used with Gravity Spawner must have Collider components. Without a Collider, objects fall through surfaces during the physics simulation.

Step 3 — Configure scatter and filters

In the Group settings, configure Scatter Settings to control how densely positions are sampled across the area. Optionally, add Mask Filters to restrict spawning to specific slopes, heights, or terrain textures. Gravity Spawner uses filter fitness both before spawning (to decide whether to spawn at a sample point) and after settling (to decide whether to keep the object at its final position).

Step 4 — Configure physics force (optional)

In the Physics Effects Settings section of the inspector, adjust the force applied to each spawned object:
  • Force Range and Min / Max Force — controls how hard each object is launched.
  • Random Strength — controls whether force is directed mostly downward (0) or in a random horizontal direction (100).
At default values (Min Force: 10, Max Force: 40, Random Strength: 50), objects receive a light push in a random direction, which adds variation to where they come to rest.

Step 5 — Configure the physics transform settings (optional)

In the prototype settings, Physics Transform Settings applies transform adjustments (position offset, rotation, scale randomization) to each object before the physics simulation starts. Adjust these if you want random rotations or scale variation before objects drop.

Step 6 — Spawn

In the Stamper Tool Controller section, click Spawn. Gravity Spawner samples positions inside the area, creates each object 30 units above its hit point, applies force, and then waits for the physics simulation to complete. The inspector shows how many simulated bodies are still active. When all bodies have settled, the pass is complete. Objects that land outside the stamper bounds, or whose final position fails the filter check, are automatically destroyed.

What’s next

  • Use Mask Filters to concentrate spawning on slopes or specific terrain zones.
  • Combine with Terrain Spawner to mix physics-settled debris with procedural vegetation.
  • Read the full Gravity Spawner reference for details on all settings.