Use meshes instead of colliders for positioning drag to instantiate in 3D #87969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proof of concept because it probably breaks compatibility, and the original solution may be more desirable in some circumstances.
If anyone is interested in it, feel free to build off it.
Some ideas:
Account for the bounds for both target and preview, so it doesn't sink into the target.
Create a mechanism to select positioning based off mesh or collisions.
Use a modifier key to ignore meshes/collisions.
Use this code to snap existing meshes to other existing meshes.
Currently the engine uses a physics-based ray to get an intersection of colliders to decide where to position the preview node. This comes with downsides such as depending on this physics tick rate, not snapping to meshes without colliders which is arguably the more intuitive behavior, and the code not being really straight forward as it needs to handle physics being ran on separate thread.
This PR uses the same cull ray that node selections use to detect a target mesh, and then calculates the intersection using the Visual Instance AABB.
2024-02-04.20-50-38.mp4