How to combine meshes for foliage

Sorry if this is a dumb question, I want to add trees to paint with as foliage, but I have the leaves as one mesh and the base of the tree as a separate mesh, and the foliage seems to only want one mesh, and one material, how do I solve this?

I have looked at that, but wouldn’t it be problematic with two different materials then?

I think I solved it but I don’t nkow if it’s the proper way of doing it, I combined the meshes with two different material nodes inside my modeling software, then when I imported the unified mesh in Unreal I could add two materials and they stick to the two different parts.