Hey all! I have a setup that spawns random tiles in a grid. I’m wondering how I would then get two random points on the landscape, draw a randomly curved line. Then do a sphere trace between them deleting any tiles in the way. Then later I’ll spawn different tiles in the now empty spots on the grid.
So basically:
Get point “A”.
Get point “B”.
Draw random, curved line between them.
Sphere trace along line.
Save HISM’s location data to an array.
Delete HISMs.
Pull empty spot’s data and populate with new tiles.
You’d have to use a mathematical function with a randomized variable to get the curved lines. You can then use a collision component on the line and use “Get Overlapping Actors” as an alternative to Sphere trace, then delete the actors that you detect.
If you’re able to get a volume along the spline, you can use “Get Overlapping Actors” to grab an array of tiles inbetween the two points, then delete each tile in the array.
Is there a way to add more points on the spline so it curves? Then sphere trace along that?
Cause won’t a sphere trace go right to the end vs a spline following it’s “path”
Okay so for some reason when I add points to the spline in construction script it has some extra(I’m assuming it starts with some). So I then clear the spline points and set three points to random tile locations. That seems to work but for some reason the sphere trace doesn’t want to fire? It’s set up exactly like yours.
The actors to be destroyed are HISM Instances so I think that is causing some problems. And for some reason the sphere trace is running multiple times?
The trace is inside the for-loop, so it’ll run for however many spline nodes there are.
You’ll probably want to adjust the “Remove Instance” part at the end, as the array index and instance index probably aren’t interacting the way you think they are.