# Unique Items without a Unique ID were duplicated for all clients

**URL:** <https://community.coherence.io/t/unique-items-without-a-unique-id-were-duplicated-for-all-clients/447>\
**Category:** Bug reports\
**Created:** [January 19, 2024, 2:43pm UTC](https://community.coherence.io/t/unique-items-without-a-unique-id-were-duplicated-for-all-clients/447 "2024-01-19T14:43:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lucash](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lucash](https://community.coherence.io/u/lucash)\
**Post date:** [January 19, 2024, 2:43pm UTC](https://community.coherence.io/t/unique-items-without-a-unique-id-were-duplicated-for-all-clients/447/1 "2024-01-19T14:43:19Z")

</div>

## Description, details and error message(s)

Coherence Sync object marked as unique but nothing entered in the Manual Unique ID is replicated for all clients. Objects without a manually entered ID all get an automatically generated unique IDs at runtime but it is different for every client, so therefore not unique anymore.

Adding a unique ID fixed the issue of the replicated objects but it wasn’t clear I should add one. Maybe the Unique ID should be generated in the bake and not runtime? or an error could stop the bake completing if the unique ID is required.

## Expected behaviour

Items marked as unique should not get replicated for each client. A warning/error should appear if the ID is not entered or an ID should be generated at bake time.

## Environment

SDK: 1.0.5  
Unity: 2022.3.9f  
OS/Platform:  
Developed on windows 10  
Deployed to web

---

<div class="post-metadata">

**Author:** ![miguel-coherence](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/miguel-coherence/32/101_2.png) [@miguel-coherence](https://community.coherence.io/u/miguel-coherence)\
**Post date:** [January 22, 2024, 8:58am UTC](https://community.coherence.io/t/unique-items-without-a-unique-id-were-duplicated-for-all-clients/447/2 "2024-01-22T08:58:15Z")

</div>

Hey lucash, thank you for your message.

This is the intended behaviour, generating an id at bake time would mean only ever 1 instance of this prefab would be able to exist, and the unique id matters at runtime, not at editor time.

If you wish to control runtime uniqueness without a manually set ID at editor time, you should look into the CoherenceBridge.UniquenessManager API where you can register unique IDs at runtime to be used by the subsequent prefab instances you spawn.

---

<div class="post-metadata">

**Author:** ![ciro](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/ciro/32/82_2.png) [@ciro](https://community.coherence.io/u/ciro)\
**Post date:** [January 22, 2024, 10:45am UTC](https://community.coherence.io/t/unique-items-without-a-unique-id-were-duplicated-for-all-clients/447/3 "2024-01-22T10:45:51Z")

</div>

> [@miguel-coherence](#):
>
> If you wish to control runtime uniqueness without a manually set ID at editor time, you should look into the CoherenceBridge.UniquenessManager API where you can register unique IDs at runtime to be used by the subsequent prefab instances you spawn.

To add to what Miguel mentioned, you can find an example of that in action in our sample [**Campfire**](https://docs.coherence.io/learning-coherence/campfire-project).

The “in action” part is thoroughly described on [this page](https://docs.coherence.io/learning-coherence/campfire-project/custom-instantiation-and-destruction). Hope it helps!

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex017/uploads/coherence/original/1X/b3aa79eb9519fac7aad7eba18f15a1e8ce60f6e2.png) [@system](https://community.coherence.io/u/system)\
**Post date:** [January 21, 2025, 10:46am UTC](https://community.coherence.io/t/unique-items-without-a-unique-id-were-duplicated-for-all-clients/447/4 "2025-01-21T10:46:29Z")

</div>

Closed on January 21, 2025, 10:46am UTC

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
