# How to set up the material for a single object in ISM

**URL:** <https://forums.unrealengine.com/t/how-to-set-up-the-material-for-a-single-object-in-ism/2069490>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [October 15, 2024, 1:25pm UTC](https://forums.unrealengine.com/t/how-to-set-up-the-material-for-a-single-object-in-ism/2069490 "2024-10-15T13:25:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![keyllll4654](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@keyllll4654](https://forums.unrealengine.com/u/keyllll4654)\
**Post date:** [October 15, 2024, 1:25pm UTC](https://forums.unrealengine.com/t/how-to-set-up-the-material-for-a-single-object-in-ism/2069490/1 "2024-10-15T13:25:54Z")

</div>

I used the PCG method to quickly generate multiple spheres in the area, but what I got was an ISM object, and I wanted the texture to change when I clicked on a single sphere object.I wonder if there’s way I can do to achieve my goal! Thanks for any advice.

 ![微信图片_20241015211842](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/3/c/33ca755fa6d82840dbfcb03668cc0ca5c259583e.jpeg)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 15, 2024, 1:32pm UTC](https://forums.unrealengine.com/t/how-to-set-up-the-material-for-a-single-object-in-ism/2069490/2 "2024-10-15T13:32:59Z")

</div>

What’s the actual end goal?

> I wanted the texture to change when I clicked on a single sphere object

This can be achieved in many ways, but all (?) of them come with caveats. What to choose depends on the details.

- replace the clicked instance with a static mesh → assign new material
- use per instance custom data
- move the instance to another ISMc

---

<div class="post-metadata">

**Author:** ![keyllll4654](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@keyllll4654](https://forums.unrealengine.com/u/keyllll4654)\
**Post date:** [October 16, 2024, 6:21am UTC](https://forums.unrealengine.com/t/how-to-set-up-the-material-for-a-single-object-in-ism/2069490/3 "2024-10-16T06:21:04Z")

</div>

Sorry for not explaining clearly. My end goal is as follows, for example, there are eighty spheres in my picture. When I click on one of them, its color turns red, which means I hope to be able to manipulate each sphere individually and set its material.  
I will try the method you mentioned.Thanks!

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [October 16, 2024, 6:53am UTC](https://forums.unrealengine.com/t/how-to-set-up-the-material-for-a-single-object-in-ism/2069490/4 "2024-10-16T06:53:05Z")

</div>

Just to clarify, these are 3 separate methods.

* * *

Colour does not need to equal a new material. If it’s about changing **just** the colour, try the `Per Instance Custom Dat`a approach - definitely the most fun to learn out of the abovementioned bunch:

> **[Storing Custom Data in Unreal Engine Materials Per-Primitive | Unreal Engine...](https://dev.epicgames.com/documentation/en-us/unreal-engine/storing-custom-data-in-unreal-engine-materials-per-primitive)**
>
> An overview of the Unreal Engine Custom Primitive Data workflow for storing custom data per primitive that's accessible through Blueprint.

In short: imagine you did not need to store colour information in a material, but you could do it in each sphere instance instead. Here’s an example:

> [@How to add a hit count (health points) to individual instances?](https://forums.unrealengine.com/t/how-to-add-a-hit-count-health-points-to-individual-instances/227176/2):
>
> 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 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 …
