I am making a castle wall and right now I am using a square for the wall and 3 capsules for the "empty" spaces. Because they're the same color as the background. Is this a proper way of approaching this or should I use UI images, make them transparent at those spots and put box colliders around them? For me it's easier and faster with the sprites but maybe it is more efficient with images.
Wall is a square on layer 0, capsule is on layer 1 and the square representing the ground is on layer 2 so it can hide the last part of the cylinder. Is there some more efficient way you could recommend me to use? Thank you.
UIImage is a UI element that exists on a Canvas. UIImage is best used as a part of the user interface (UI), e.g. Buttons, overlays and so on.
In your case, the castle is an object in the game world, so it is better to use Sprite Renderer, as the other objects in the game will probably exist in the game space, not UI space, as well.