This is kind of two questions, hope that doesnt break any rules.
Situation:
My level is divided into 50x50 squares and planters are set to snap to these squares. the planters consist of a soil bed, (a plane) and 4x side static meshes, rotated to be on each side of the plane. If two are placed next to each other the side meshes between them is set to not visible.
I currently have the functionality of this set up like this.
After that is done I use a box overlap to get all overlapping actors and do the same check on them. as seen here:
This ALL works but It occured to me that i could just use the overlapping box to calculate all of this by using a for each loop and checking if they are in range (+50+50, +50-50, -50-50 and -50+50).
Anyway. I was just wondering if that would be a cheaper way of doing those calcs?
I have found that this specific blueprint (Which doesn’t contain a whole lot more than you see here) takes about 45 seconds to compile, while others (some more complex,) are instant. I’m wondering if the line traces are the issue?
So 1: which is cheaper
line trace > hit actor > is valid?
or
overlapping actors > for each loop > in range?
and 2 can you see anything in my code here that could suggest an alterantive reason for slow compile times?
Currently i think there are a maximum of 32 line traces happening at each player interaction (The repetition of this is limited to how fast the player can move the mouse to the next square and click).
appreciate any help.