# Getting per instance HISM data

**URL:** <https://forums.unrealengine.com/t/getting-per-instance-hism-data/1375600>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [November 9, 2023, 10:58am UTC](https://forums.unrealengine.com/t/getting-per-instance-hism-data/1375600 "2023-11-09T10:58:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [November 9, 2023, 2:05pm UTC](https://forums.unrealengine.com/t/getting-per-instance-hism-data/1375600/2 "2023-11-09T14:05:42Z")

</div>

In BPs that’d be a no-no. In C++ perhaps? Google confirms this exists:

```auto
GetCustomDataValueOnInstance

```

But I’ve never seen it done or even documented…

* * *

Besides the above:

> so I need a fair amount of additional data for each mesh

The official docs state one can store 32 floats, which is not true - at least it wasn’t in 4.27. The actual number is either 16 or 18 - last time I tested it. Which is still plenty but it’s just floats.

> [@Dale\_Wastell](#):
>
> can’t get around the indexing problems as plants get eaten

How I do it:

- use the Tmap with key being the index and enjoy any data type via a struct
- never **remove** instances
- instead, **move** them where they can’t bother you; flag its `hasBeenEaten` map data appropriately
- bunny eats a carrot? That carrot now lives 5000 uus underground where no sensible bunny should go
- to regrow it, reuse one of the eaten carrot instances that lives underground
- at some point you’ll need to save it all - that’d be the time to trim the HISMc and repopulate the map from scratch

Think of this as of object pooling. The key is to not remove any HISM instances.

* * *

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 …

---

_[View the full topic](https://forums.unrealengine.com/t/getting-per-instance-hism-data/1375600)._
