Everynone
(Everynone)
December 5, 2023, 12:27am
2
The instances of a single I nstanced S tatic M esh C omponent 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:
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
The name of the game is Custom Primitive Data (check docs at the bottom).
The material for a brick:
each instance stores a float which is used to Lerp between 2 colours (to visualise hits remaining)
this can (and probably should) get prettified
[image]
Making a brick wall:
create a bunch of instances and store their data in an int | int Map
instead of an integer, you could have a struct and hold all kind of data here; perhaps this brick is worth some coins, or explodes when destroyed and …
https://docs.unrealengine.com/5.3/en-US/storing-custom-data-in-unreal-engine-materials-per-primitive/
This would actually allow you to achieve what you want. 1 ISM, 1 material, as many colours as you need.
1 Like