I have seen a few people having strange results when using this blueprint feature but I haven’t seen a solution. My current project makes use of this a lot and with certain meshes the results seem to be different to what I am expecting.
I decided to create a new project to test this out so hopefully someone from Epic can have a look for me, I can upload this project if you need it.
Here are a couple of screenshots of the issue…
The cube is a blueprint actor with an instanced static mesh component which is drawing one cube instance. The white sphere has a repeating delay of 1 second which calls “Get instances overlapping sphere” using its world location and prints the results of how many instances it is overlapping. In this case 0 which is what I would expect.
In this second picture I have moved the white sphere closer while simulating in editor and it starts returning a result of 1 when it is still quite far away from the cube instance. I have tried this with using a radius of 0, 0.1, 1 etc and it still always returns a positive overlap even when it is not touching the cube instance. This is when using the Cube mesh from /Engine/EngineMeshes/Cube.
As I said before, it seems to act different for different meshes. Using the cube from /Engine/BasicShapes I get this result…
When using a shape that isn’t as regular as a cube I get even less consistent results it seems…
All objects are using a scale of 1 and it doesn’t seem to matter what type of collision they have.
Please let me know if I am doing something wrong or if this could be a bug?
Sorry for the delay. I plan to look into this asap. Could you upload the test project you mentioned?
We haven’t heard back from you in a few days, so we are marking this post as resolved for tracking purposes. If you’re still experiencing this issue, please upload the project you mentioned and comment to reopen the post.
Sorry I didn’t see a message from you guys, my bad.
Project should be attached. If you simulate, then drag the sphere near the cube it should show you what I mean. If you change the static mesh in the static mesh instance blueprint you should see some different behaviours depending on the mesh.
Thanks a lot.
Having similar problems with the GetInstancesOverlappingSphere method but using the C++ version in UHierarchicalInstancedStaticMeshComponent. GetInstancesOverlappingBox had similar problems before 4.15 but was fixed https://github.com/EpicGames/UnrealEngine/commit/29fca7a767f61025bcd8ad0f3f346c68ba6af6b0
I was able to reproduce this with the project you include. Thank you for uploading it by the way.
I believe this to be a bug, so I created JIRA UE-45142 and our developers will be investigating further. Follow that link to monitor the status of the report.
As for the fix Phelioz mentioned, I believe it fixed some core scaling functionality but not the issue you are seeing. What you are seeing is still occurring in 4.15 and later builds.
Here is the note the dev provided on the internal JIRA.
The functionality of
operates on the instance mesh bounds.
If you rotate the fence you can see
that the overlap happens once the
bounds of the sphere overlap with the
bounds of the mesh. This is reflected
by the tooltip above the blueprint
We are considering renaming the node to make that more clear. Sorry for any confusing this caused.
Hey. Thanks for that.
I have been keeping an eye on the bug report and it says “By Design” as the status. Can you explain what that means? Is it supposed to work like that and there will be no fix?
Can we get something added that doesn’t rely on the bounds to find the instanced mesh?