How to connect objects without messing up the Materials ?

So the titel says it all.
The problem is i want to UV the entire object, but when i join the objects or parent them it changes the entire object to the main material and texture or the objects are still not one so i can UV the entire object.

Joining (Ctrl + J) and (Ctrl + P) both won’t work.

So any suggestions


How can i UV unwrap 2 objects or join them without messing up the materials ?

Not sure what you’re talking about. When objects are joined, every face in the mesh keeps its material it had before joining. So no change there. Only faces without any material will get the active material assigned

Ctrl+P (parenting) does not effect materials or UVs either. It basically make one object follow another. Nothing more.

Sorry found a solution.

I just assigned the vertices the right materials as Sogo said.