# I want to hide an instance c++

**URL:** <https://forums.unrealengine.com/t/i-want-to-hide-an-instance-c/433494>\
**Category:** C++\
**Tags:** box, unreal-engine, instances, CPP, question\
**Created:** [September 9, 2018, 8:54pm UTC](https://forums.unrealengine.com/t/i-want-to-hide-an-instance-c/433494 "2018-09-09T20:54:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielf94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@danielf94](https://forums.unrealengine.com/u/danielf94)\
**Post date:** [September 9, 2018, 8:54pm UTC](https://forums.unrealengine.com/t/i-want-to-hide-an-instance-c/433494/1 "2018-09-09T20:54:08Z")

</div>

I have 3 instances and I want to hide 1

example: to delete an instance used Box-\>RemoveInstance(1);

how can I hide an instance in the same way, for example I want to hide instance “1”??

I can hide it in this way, modifying the scale:

Box-\>UpdateInstanceTransform(instancia, FTransform(FVector(0, 0, 0)), true, true);

---

<div class="post-metadata">

**Author:** ![danielf94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@danielf94](https://forums.unrealengine.com/u/danielf94)\
**Post date:** [September 14, 2018, 6:08am UTC](https://forums.unrealengine.com/t/i-want-to-hide-an-instance-c/433494/2 "2018-09-14T06:08:11Z")

</div>

@erikdubbelboer

> **[UMeshComponent::SetMaterial](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/Components/UMeshComponent/SetMaterial/)**
>
> Changes the material applied to an element of the mesh.

virtual void SetMaterial  
(  
int32 ElementIndex,  
UMaterialInterface \* Material  
)

apparently “Element Index” is for the element to access the material, no to the index of the instance

---

<div class="post-metadata">

**Author:** ![erikdubbelboer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@erikdubbelboer](https://forums.unrealengine.com/u/erikdubbelboer)\
**Post date:** [September 14, 2018, 6:24am UTC](https://forums.unrealengine.com/t/i-want-to-hide-an-instance-c/433494/3 "2018-09-14T06:24:34Z")

</div>

I don’t think setting a material per instance is possible then. Maybe this can help you with what you want to achieve: [Customise UVs per instance with Instanced Static Meshes - Rendering - Unreal Engine Forums](https://answers.unrealengine.com/questions/502169/customise-uvs-per-instance-with-instanced-static-m.html)
