# Replicating floats efficiently

**URL:** <https://forums.unrealengine.com/t/replicating-floats-efficiently/1882283>\
**Category:** Multiplayer & Networking\
**Tags:** unreal-engine, question\
**Created:** [May 31, 2024, 10:20am UTC](https://forums.unrealengine.com/t/replicating-floats-efficiently/1882283 "2024-05-31T10:20:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gord10Ahmet](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/gord10ahmet/32/1072959_2.png) [@Gord10Ahmet](https://forums.unrealengine.com/u/Gord10Ahmet)\
**Post date:** [May 31, 2024, 10:20am UTC](https://forums.unrealengine.com/t/replicating-floats-efficiently/1882283/1 "2024-05-31T10:20:55Z")

</div>

Is there a recommended, efficient way to replicate floats whose value can change at each tick?

My approach is making the float value itself non-replicated, then casting the float to an integer that’s replicated. This approach works in cases like we are keeping the battery of a camcorder and the client only sees the battery bars of their camcorder (like 1 of 3 bars). I’m curious if there’s a better way to do this.

I’ve read this [thread](https://forums.unrealengine.com/t/replicate-rotator-or-2-floats/653882) by the way, but my question wasn’t answered there.

---

<div class="post-metadata">

**Author:** ![HawaiianGamer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hawaiiangamer/32/950473_2.png) [@HawaiianGamer](https://forums.unrealengine.com/u/HawaiianGamer)\
**Post date:** [May 31, 2024, 1:15pm UTC](https://forums.unrealengine.com/t/replicating-floats-efficiently/1882283/2 "2024-05-31T13:15:04Z")

</div>

I did something similar with controller analog stick input. I created a 8 bit value for two axis input in one byte for each axis to have a range of [-7…+7]. When you think about it, that is all the resolution one needs for most stick input needs, since it was only replicated to indicate which animation to play (forward, backward, strafe, or blend combo; run, walk, or stance).

I think your approach makes sense, and I would try to push only 2 bits across the wire if the UE replication supports it.
