Zylann / godot_scatter_plugin

A tool to help placing lots of environment props in a scene
187 stars 29 forks source link

Plugin places multiple meshes at the same position in a single click. #7

Open TheConceptBoy opened 3 years ago

TheConceptBoy commented 3 years ago

Godot 3.3.2

If I hold the mouse button, the plugin continuously places scenes where the mouse is. Sometimes It does so by a dozen, so even if I quickly click the mouse, it can place 2 or 3 scenes in the same place at once.

If I hold the mouse for even half a second I end up with 3 dozen scenes, most of which are stacked in the same position.

Zylann commented 3 years ago

This happens because the plugin estimates distances based on the bounding box of the scene. Turns out Sprite3D always returns an empty AABB: https://github.com/godotengine/godot/issues/49898

TheConceptBoy commented 3 years ago

I see. So is there an alternative method of doing it? Perhaps with ray casting?

Zylann commented 3 years ago

I did not rely on raycast originally because it would require scenes to also have a collider, I didnt want to put this restriction. But I have some ideas to workaround this, by applying a patch for Sprite3D, and also making sure nothing gets painted continuously when the mouse does not move. And of course there could be an option to increase the margin manually

Zylann commented 3 years ago

With 7161d8567df1a3bd25d168bb0ade7c8761f1cae1 objects should no longer be spammed if you dont move the mouse. A single click should place a single object. Also with bbce138c66d7551d3aaf6a4a7a0b15fb12127504 you can increase the margin manually.