A simple tool to randomly place meshes.
Note: This plugin was created for Godot v4. If you are using Godot 3.5 (or older), you can find the corresponding plugin in the 3.5 branch.
video_01.mp4
video_02.mp4
video_03.mp4
- Scatter objects in the scene using a MultiMeshInstance node.
- Adjust the instance count, size, and collision layer.
- Randomize size and rotation of each instance.
- Automatically rotates each instance to the normal of the terrain.
- Advanced constraint options to scatter according to:
- Vertex color
- Terrain Angle
- Download this repository or download the addon from the AsseLib in Godot.
- Import the addons folder into your project.
- Activate MultiMesh Scatter under Project > Project Settings > Plugins.
- Add a MultiMeshScatter node to the scene.
count
: The number of instances to generate.scatter_type
: Defines the scatter type. (Box / Sphere)scatter_size
: The size of the bounding box. Enableshow_debug_area
to view the size of the bounding box. Note: If thescatter_type
is set to Sphere, only the x value will be used to specify the radius of the sphere.collision_mask
: The physics collision mask that the instances should collide with.mesh_instance
: A helper parameter, set a MeshInstance3D here and it's mesh will be used for scattering (avoids having to copy/paste)
offset_position
: Add an offset to the placed instances.offset_rotation
: Add a rotation offset to the placed instances.base_scale
: Change the base scale of the instanced meshes.min_random_size
: The minimum random size for each instance.max_random_size
: The maximum random size for each instance.random_rotation
: Rotate each instance by a random amount between.-random_rotation
and+random_rotation
.
use_angle
: If enabled the scattering will only happen where the collision angle is above the specified threshold. (See Below)angle
: The maximum angle allowed for object to be added. Lower this to prevent scattering on more vertical surfaces.use_vertex_colors
: If enabled the scattering will only happen where vertex color of the surface below the specified threshold. (See Below)r_channel
: Scatter threshold for the red channel.g_channel
: Scatter threshold for the green channel.b_channel
: Scatter threshold for the blue channel.randomize_seed
: Enabling this will randomize the seed then turn this off again (kind of a button in the editor)seed
: A seed to feed for the random number generator.show_debug_area
: Toggle the visibility of the bounding box area.
- The sphere placement type takes
placement_size.x
for the radius. The y and z values are not used. - The sphere placement type behaves more like a capsule shape. This means that only the horizontal radius is taken into account when scattering meshes.
- Scattering occurs automatically in the editor whenever you change a parameter or move the MultiMeshScatter node. In game mode, the scatter occurs once at the beginning of the game.