Random Positioning but with minimum distance (3d) (Solved)

I want to generate a random forest with about 5 different types of trees.
This is the code i use for it.

And this is the result.

So my problem is, how can i get that this is possible.

Screenshot 2024-01-29 101215

And this dosnt happen.

Screenshot 2024-01-29 101317

The seperate Trees from Trees works only for Trees of the same type and seperate them at the treetop and not at the trunk like i want it.

Hi @Floki204

You can try to stick the tree to the hitbox instead of the other way around, and separate the hitboxes away from each others, since the hitbox is only half the size of the tree (similar to the size of the trunk).

Hope this helps!

When i stick the Trees group to the Hitbox the sticking dosnt work, i dont know why

The hitbox and the trees have both the sticker behavior

You need to separate hitboxes from each others not the the trees (last action).

Also did you try to place the “stick trees to hitbox” in the same event after you create the objects? You don’t need to check for nearest object to stick them, but I’m not sure if you already tried it and it doesn’t work after creating two objects at the same time.

“Stick Hitbox to Trees” works in the same event but “Stick Trees to Hitbox” dosnt work

Tried your events and everything worked for me. Can you share a screenshot of your updated events?

I’m at work rn so unfortunately not.
But I also figured out that for some reason the draggable behaviour works for the trees but not for the hitboxes. When I’m back from work I will try to create a new hotbox object and try it with that

So i deleted the old hitbox object and created a new one and now it works with the same code