I have a grid of planes and I’m trying to get a static mesh to collide with all of them under it but it will only pick up a certain amount of them. It only picks up about half the collisions no matter how long I make the cube.
There should be 5 actors in the array but I used a Print node to find that only 3 of them are being found. (the ones that are deleted in the pic above)
The reason I’m doing it like this is because the other way I was doing it won’t detect the collision when I press play with On Component Begin Overlap. If I add physics to the cube and drop it from above the collider first it will trigger all the colliders like I want but that isn’t very practical.
I’m not sure what the delay would do. The above script is for finding all actors in the array that have collided with the Cube mesh. The cube mesh is not colliding with every grid actor below it. It’s only finding a certain percent regardless of how big the cube is. So the array doesn’t contain the remaining grid actors for some reason.
The other script I had tried previously only wont work because the colliders won’t detect that they are already touching when I press Play.
It would ensure that everything else is properly initialised first.
From my point of view I do not know how these ended up in the level (placed manually, streamed in, spawned dynamically, perhaps they’re instanced hierarchical static meshes with material vertex offsets - each of the above will behave differently, especially on Begin Play)
Adding a delay is the first, simplest check I’d do. Does it behave the same with Delay?
Imagine performing the above check only when half the grid plates are added in. Component queues can get complicated. Again, grasping at straws here as nothing else stands out, at least not when following the logic of the included description.
Perhaps there are more elements at play here, things we cannot see.
Thanks for your help. Ok a delay after Event Begin Play did not change anything. The cube is a blueprint actor but not spawned in on runtime or anything. Just static.
Here I added a print node to see how many objects are in the array and only 3 of the 5 are in the array even though the cube is hitting all 5 of them. works on the first 3 and not the last 2. You can see the array indexs printed on the screen here.
Solved it. I wasn’t promoting the array to a variable before the For Each Loop. Creating the variable first instead of feeding the array from the Overlapping actors directly into the For Each Loop fixed it.