Procedural Mesh Component behaving weirdly when trying to apply material

So basically I’m making procedural terrain using the procedural mesh component, and it works totally fine, until I apply different materials to it. Here’s the Issue. So basically I have a macro from a macro library which gets the material based on x,y,z position triangles. and when I just always return one material I get this

Then when I add any sort of actual selecting stuff, I’ve tried dozens of different things, all return similar results, then I get this.

So the triangles are actually not there, they’re not on the back side or invisible, even wireframe mode confirms this. I iterated through my various loops and everything checks out, all vertices are being correctly input into the arrays and all triangle/UV/Material data is correct, they just simply aren’t there and I have no idea why. Would appreciate any help.

Here’s some code

Well of course, after hours of trying to figure it out I post and within minutes I solve it myself…sigh
How do I mark this as answered or remove it? I can’t seem to find that. Knowing my luck I’ll find it in about 30 seconds after posting this…Thanks anyway though!

How did you solve it?