MapEditor icon indicating copy to clipboard operation
MapEditor copied to clipboard

Painter

Open Powback opened this issue 7 years ago • 2 comments
trafficstars

You should be able to "paint" objects by adding them into a list, and simply paint them on top of whatever.

Raycast implementation: image

Use s2w to get the brush position, and get the position that's X units above that. Then use the brush settings to do a scatter raycast, and spawn a random object from that list. The list can also be weighted, so that some objects have a higher probability of spawning.

This is useful for things like vegetation, clutter and effects.

I suggest that the painting is initially only done on the client, and whenever the client lets go of the brush, the objects are sent to the server.

The result should be a new prefabblueprint which contains references to all the spawned objects.

Powback avatar Oct 03 '18 07:10 Powback

how are you gonna prevent overlapping?

3ti65 avatar Oct 03 '18 08:10 3ti65

if distance == tooclose then 
    dont()
end

Powback avatar Oct 03 '18 09:10 Powback