Currently, when adding a new shape through drag-and-drop, the placement is calculated using the topmost position of the existing structure and the mouse pointer’s position. However, this approach causes the shape to always go to the top of the structure, even when there’s an empty space where it should ideally be placed. Suggest some logic to filling them during drag-and-drop.This would make more user friendly and visually consistent while dragging.
i also tried to implement drag and drop. It cant work. I also have confusion in here
I don’t know what you are using to implement drag and drop… but its not a simple problem to determine Where to drop an asset that has been dragged into the scene. You can guess that it should be somewhere under the mouse cursor, but there isn’t a trivial way to know the scale of your scene, or how far along the mouse cursor ray to place the object, without doing some kind of rules based system like… raycasting from mouse cursor to the floor, and placing the object there…
Or placing a plane at 0,0,0 that is facing the camera, and raycasting against that plane, and dropping the object there. It really depends on what kind of app you are building, how that should behave.