Prefab with canvas inside not working on "horizontal layout group"

On my current project i have prefab’s with individual canvas, when i try organize then on a “horizontal layout group” they just dont work…

In this exemple the “horizontal layout group” is on “Panel” and the “Image” just ignore it.

With this code bellow its works, but a lose the individual canvas:

GameObject.Find("Image").transform.SetParent(GameObject.Find("Panel").transform, true);

Any suggestions?
Very thanks!

Check this out, this might help :


Horizontal layout groups only work on the direct children of the component. The Image needs to be a child of the panel to be at all affected. (This is why your code snippet works)

May I ask why you need the Canvas2 object? Does it serve a special purpose in your project?