How can I get all index from for loop in blueprint

Hi,
I am a 3d artist completely new to blueprint, and I was trying to create a Christmas lighting system by using spline tool, my idea is let the odd number have yellow emissive material, and even number have blue one, so yellow blue yellow blue yellow blue etc. What I did is get the index from for loop, add a branch, if index %2 == 0, set yellow material, if not goes to blue. however, the for loop seems only return the last index, so material only change when the total number of element in my spline tool change. Is their anyone know where I did wrong? thanks!


1 Like

The instances of a single Instanced Static Mesh Component can only have 1 mesh and 1 material. What you’re doing will not work. Whenever you assign a material, you do not really assign it to an instance - you assign it to all instances of this one component.

You have some options:

  • you could have 2 ISMc:

The material can be pre-set on the component in the details panel.

  • instead of ISMc, you could use as many regular Static Mesh Components as there are lights:

  • there is also a more involved technique - Custom Primitive Data

This would actually allow you to achieve what you want. 1 ISM, 1 material, as many colours as you need.

1 Like

thank you so much, I added an extra ISMc, and this solved my problem!!!

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.