Question: I'm trying to set a different existing material on 5 Instances made with Instance on Points. Trying both 3.0.1 and 3.1 to no avail.

Is there any value or attribute that signifies which instance you are on?

I want to build a setup for texture painting with 5 copies of a character and therefore I am linking a rigify rig with the meshes that gets instanced. That seems to make it trickier if not impossible to do custom attributes.
Either want to change material for each copied instance or have some way to swap textures in a shader graph. As long as you can paint a different texture on each copy.

I've tried these three answers to similar issue without results:
[Set material for instances problem (Blender 3.0)](https://blender.stackexchange.com/questions/244208/set-material-for-instances-problem-blender-3-0),  

[Control Instance Color with Geometry Nodes](https://blender.stackexchange.com/questions/213224/control-instance-color-with-geometry-nodes),  

[How to assign a different material color to each geometry nodes instance](https://blender.stackexchange.com/questions/254648/how-to-assign-a-different-material-color-to-each-geometry-nodes-instance)

Answer: 
After a bit of faffing around, I've so far established that the *Set Material Index* node will work only if the incoming geometry, with materials assigned to slots, is on the same branch. The materials do not have to be assigned to faces of the incoming geometry... it just has to have its slots filled.

In this example, the incoming geometry is just a plane, with 4 material slots.

[![enter image description here](https://i.stack.imgur.com/Vl4WS.png)](https://i.stack.imgur.com/Vl4WS.png)

Cubes instanced on a line have their instance indices stashed, before *Realize Instance* wipes them.

A function of the stashed indices is used to *Set Material Index*, while the (material-slot-bearing) incoming geometry is on the same branch.

The incoming geometry has been tagged, so can be selectively deleted before output.

[![enter image description here](https://i.stack.imgur.com/9LAB4.png)](https://i.stack.imgur.com/9LAB4.png)

The GN-generated cubes are now assigned the separate materials, per-instance, as expected.
`STORE NAMED ATTRIBUTE` for points with value as `ID` before `INSTANCE ON POINTS`, then `NAMED ATTRIBUTE` integer using the same name from the `STORED NAMED ATTRIBUTE` on the ID for the selection on a `RANDOM VALUE` using boolean
[![enter image description here](https://i.stack.imgur.com/LB0M9.png)](https://i.stack.imgur.com/LB0M9.png)