Hi. I’m working on world generation. At first stage it creates actors and then generates world graph by checking collision via traces.
My problem is that traces don’t work on objects (actors or mesh components) that were just created. If I call SpawnActor and then LineTraceSingleByChannel - it returns empty response. I tried to wait for actor’s BeginPlay, but it also didn’t work - it still returns empty response.
For now I added workaround - after SpawnActor I wait few seconds and then continue generation process. But it is not right solution - I need somehow determine if actor’s (or mesh component) physics is ready. For now I see the only solution - periodically call trace and wait until it returns response.
I found problem with actor tracing after spawn - looks like I use wrong location. Will investigate static mesh component spawn.
I solved problem with mesh components. I use UInstancedStaticMeshComponent to spawn grass. Grass mesh has collision and respons to only one channel. Right after spawn I run algorithm which calls trace many times, but for other channel. Grass shouldn’t affect it, but tracing takes much time due grass collision. My workaround worked - after 1 second delay grass stops to affect tracing. But I have found better solution - I just disable all grass collision during tracing.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.