# Set Custom Data Value of Instace Static Mesh doesn't allow the FPrimitiveInstanceId

**URL:** <https://forums.unrealengine.com/t/set-custom-data-value-of-instace-static-mesh-doesnt-allow-the-fprimitiveinstanceid/2856632>\
**Category:** Blueprint\
**Tags:** unreal-engine, question\
**Created:** [November 16, 2026, 11:18am UTC](https://forums.unrealengine.com/t/set-custom-data-value-of-instace-static-mesh-doesnt-allow-the-fprimitiveinstanceid/2856632 "2026-11-16T11:18:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [November 16, 2026, 11:18am UTC](https://forums.unrealengine.com/t/set-custom-data-value-of-instace-static-mesh-doesnt-allow-the-fprimitiveinstanceid/2856632/1 "2026-11-16T11:18:42Z")

</div>

Hi!

I’m using the `Instanced Static Mesh component` in an actor. To create the instances I use cpp, but I want to modify a custom data value of one instance with this code:

 ![imagen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/9/3/793a7091151e6bf5c161be7d7daf2076a8c517e1.png)

The `Set Custom Data Value` node needs an Integer parameter, `Instance Index`. But, when I create a new Instance Static Mesh in CPP it returns a `FPrimitiveInstanceId` value:

```cpp
/**
 * ID of an instance within a primitive, persistent for the lifetime of the instance. 
 * Can be used as a linear index as the maximum possible value is never higher than the high-water-mark for the number of instances in the component.
 */
USTRUCT(BlueprintType)
struct FPrimitiveInstanceId
{
	GENERATED_BODY()
	inline bool IsValid() const { return Id != INDEX_NONE; }
	inline bool operator==(const FPrimitiveInstanceId &Other) const { return Other.Id == Id;}

	inline int32 GetAsIndex() const { return Id; }

	friend FArchive& operator<<(FArchive& Ar, FPrimitiveInstanceId& InstanceData)
	{
		Ar << InstanceData.Id;
		return Ar;
	}

	int32 Id = INDEX_NONE;
};

```

But I can’t use it with the `Set Custom Data Value` node.

Any advice?

Maybe I have to use the CPP version:

```cpp
ENGINE_API void SetCustomDataValueById(FPrimitiveInstanceId InstanceId, int32 CustomDataIndex, float CustomDataValue);

```

Thanks!
