         {
             if (editorScene.octree is null)
                 return;
+
             RayQueryResult result = editorScene.octree.RaycastSingle(cameraRay, RAY_TRIANGLE, camera.farClip,
                 pickModeDrawableFlags[pickMode], 0x7fffffff);
+
+            // Randomize in a circle around original hit position
+            if (spawnRadius > 0)
+            {
+                Vector3 position = RandomizeSpawnPosition(result.position);
+                position.y += spawnRadius;
+                result = editorScene.octree.RaycastSingle(Ray(position, Vector3(0, -1, 0)), RAY_TRIANGLE, spawnRadius * 2.0,
+                    pickModeDrawableFlags[pickMode], 0x7fffffff);
+            }
+
             if (result.drawable !is null)
                 PlaceObject(result.position, result.normal);
         }

                editorScene.physicsWorld.UpdateCollisions();

            PhysicsRaycastResult result = editorScene.physicsWorld.RaycastSingle(cameraRay, camera.farClip);
            if (result.body !is null)
                PlaceObject(result.position, result.normal);
        }

    SetSceneModified();
}

Vector3 RandomizeSpawnPosition(const Vector3&in position)
{
    float angle = Random() * 360.0;
    float distance = Random() * spawnRadius;
    return position + Quaternion(0, angle, 0) * Vector3(0, 0, distance);
}

void SpawnObject()
{
    if(spawnedObjectsNames.length==0) return;
    IntRect view = activeViewport.viewport.rect;
    
    for(int i=0;i<spawnCount;i++)
    {
        IntVector2 pos = IntVector2(ui.cursorPosition.x,ui.cursorPosition.y);
        Ray cameraRay = camera.GetScreenRay(
            float(pos.x - view.left) / view.width,
            float(pos.y - view.top) / view.height);
