                 editorScene.physicsWorld.UpdateCollisions();
 
             PhysicsRaycastResult result = editorScene.physicsWorld.RaycastSingle(cameraRay, camera.farClip);
+
+            // Randomize in a circle around original hit position
+            if (spawnRadius > 0)
+            {
+                Vector3 position = RandomizeSpawnPosition(result.position);
+                position.y += spawnRadius;
+                result = editorScene.physicsWorld.RaycastSingle(Ray(position, Vector3(0, -1, 0)), spawnRadius * 2.0);
+            }
+
             if (result.body !is null)
                 PlaceObject(result.position, result.normal);
         }

    SetSceneModified();
}

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

        {
            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);
        }
