# Replicated random character selector

**URL:** <https://forums.unrealengine.com/t/replicated-random-character-selector/481823>\
**Category:** Character & Animation\
**Tags:** unreal-engine, question, replicating\
**Created:** [April 13, 2021, 3:24am UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823 "2021-04-13T03:24:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brownie\_Shytles2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brownie\_Shytles2](https://forums.unrealengine.com/u/Brownie_Shytles2)\
**Post date:** [April 13, 2021, 3:24am UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823/1 "2021-04-13T03:24:15Z")

</div>

Hello, I made a function where it makes the base character a random character mesh for my multiplayer game. I tried making the function replicated by making custom events but it doesn’t seem to work.

[https://i.gyazo.com/4a18568975d82eb0a1cb4d94c701f7a4.png](https://i.gyazo.com/4a18568975d82eb0a1cb4d94c701f7a4.png) - The random character selector function

[https://i.gyazo.com/6e3fc57d04bff58601ab921ee831d16c.png](https://i.gyazo.com/6e3fc57d04bff58601ab921ee831d16c.png) -custom event thing

---

<div class="post-metadata">

**Author:** ![GrumbleBunny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrumbleBunny](https://forums.unrealengine.com/u/GrumbleBunny)\
**Post date:** [April 13, 2021, 7:42am UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823/2 "2021-04-13T07:42:53Z")

</div>

I’d suggest using a RepNotify property.

1. On the server pick a random integer in range and set a RepNotify property to the random value selected.
2. In the RepNotify function, put your “Select” logic using the property value.

This will mean that the server picks a random character and then replicates the selected character index to all clients.

---

<div class="post-metadata">

**Author:** ![Brownie\_Shytles2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brownie\_Shytles2](https://forums.unrealengine.com/u/Brownie_Shytles2)\
**Post date:** [April 14, 2021, 4:00am UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823/3 "2021-04-14T04:00:50Z")

</div>

It seems to work but when I create widgets that show the characters Icon characters they don’t work.

> **[Gyazo](https://gyazo.com/dffa4d157efcbe277979b68fb20b8ff5)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

The server is ghost face but it is showing the pyramid head icon, sometimes the client’s icon matches with the characters model but sometimes it doesn’t

---

<div class="post-metadata">

**Author:** ![GrumbleBunny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrumbleBunny](https://forums.unrealengine.com/u/GrumbleBunny)\
**Post date:** [April 14, 2021, 6:03am UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823/4 "2021-04-14T06:03:36Z")

</div>

Hard to tell what’s going on without seeing the blueprints but the logs suggest the logic is running for both characters on both client and server.

---

<div class="post-metadata">

**Author:** ![Brownie\_Shytles2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brownie\_Shytles2](https://forums.unrealengine.com/u/Brownie_Shytles2)\
**Post date:** [April 14, 2021, 6:56pm UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823/5 "2021-04-14T18:56:23Z")

</div>

It’s fine I fixed the problem

---

<div class="post-metadata">

**Author:** ![UE5.Makhsoon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UE5.Makhsoon](https://forums.unrealengine.com/u/UE5.Makhsoon)\
**Post date:** [November 15, 2022, 12:10am UTC](https://forums.unrealengine.com/t/replicated-random-character-selector/481823/6 "2022-11-15T00:10:06Z")

</div>

This actually works great. Thanks.
