# C++ SetRelativeLocation() for multiplayer on a component for Custom positions like Prone

**URL:** <https://forums.unrealengine.com/t/c-setrelativelocation-for-multiplayer-on-a-component-for-custom-positions-like-prone/689743>\
**Category:** Multiplayer & Networking\
**Tags:** unreal-engine, UE5-0\
**Created:** [November 13, 2022, 11:54am UTC](https://forums.unrealengine.com/t/c-setrelativelocation-for-multiplayer-on-a-component-for-custom-positions-like-prone/689743 "2022-11-13T11:54:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EggMenace](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EggMenace](https://forums.unrealengine.com/u/EggMenace)\
**Post date:** [November 13, 2022, 11:54am UTC](https://forums.unrealengine.com/t/c-setrelativelocation-for-multiplayer-on-a-component-for-custom-positions-like-prone/689743/1 "2022-11-13T11:54:44Z")

</div>

I’m posting this to help anyone out and also my future self should I forget.

**The goal:** I was recently trying to implement prone position on Third Person FPS using C++. To do this I had to Lerp my Mesh relative to the location of the capsule using _GetMesh()-\>SetRelativeLocation()_ otherwise it would lay below the ground’s surface when the capsule shrinks.

**The problem:** Simply Lerping using _GetMesh()-\>SetRelativeLocation()_ works fine on the Listen Server, but not on the clients. Client’s mesh would still lay below the surface.

**The solution:** Be sure that when you use GetMesh()-\>SetRelativeLocation() that you also set an _FVector_ variable that’s part of the _ACharacter_ Class called _BaseTranslationOffset_ to the same value. Setting this value alone will cause the correct behavior on the Clients but not the Server. Of course you must still use these functions on ther Server and/or using RPC calls.

```auto
			GetMesh()->SetRelativeLocation(MeshCurrentRelativeLocation, false);
			BaseTranslationOffset = MeshCurrentRelativeLocation;

```

---

<div class="post-metadata">

**Author:** ![Marmelo.art](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Marmelo.art](https://forums.unrealengine.com/u/Marmelo.art)\
**Post date:** [August 6, 2025, 1:07am UTC](https://forums.unrealengine.com/t/c-setrelativelocation-for-multiplayer-on-a-component-for-custom-positions-like-prone/689743/2 "2025-08-06T01:07:00Z")

</div>

> [@EggMenace](#):
>
> **The solution:** Be sure that when you use GetMesh()-\>SetRelativeLocation() that you also set an _FVector_ variable that’s part of the _ACharacter_ Class called _BaseTranslationOffset_ to the same value. Setting this value alone will cause the correct behavior on the Clients but not the Server. Of course you must still use these functions on ther Server and/or using RPC calls.
> 
> ```auto
> GetMesh()->SetRelativeLocation(MeshCurrentRelativeLocation, false);
> BaseTranslationOffset = MeshCurrentRelativeLocation;
> 
> ```

Thank you very much, I was also implementing “Prone” and had the same problem, not even chatgpt could find the solution.
