# Networking client-server for a simple interaction

**URL:** <https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121>\
**Category:** Multiplayer & Networking\
**Tags:** unreal-engine, question\
**Created:** [July 2, 2024, 2:19pm UTC](https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121 "2024-07-02T14:19:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flav-yo1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Flav-yo1](https://forums.unrealengine.com/u/Flav-yo1)\
**Post date:** [July 2, 2024, 2:19pm UTC](https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121/1 "2024-07-02T14:19:37Z")

</div>

Hello everyone, i’m struggling creating a simply door opening in a network level. I’m using Collab Viewer Template, settled down as a “Listen Server”.  
I created my sliding door blueprint and set it as “Replicates”.  
At the moment if the host (server) modifies something, everithing works fine, and all the clients are updated, but if client interact, it works just on client side, server aren’t updated and no propagation happens obviously.  
I’m using RepNotify on the boolean variable, and i tried to link also “remote authority” to the toggle node, but just on client side works.

 ![Screenshot 2024-07-02 160519](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/e/4aebc559a9d0003f8774501ca8530f45ff642d2d.png)

 ![Screenshot 2024-07-02 160551](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/4/c/14c622fe2a1e4f1619e1ef82432147c97068f799.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [July 2, 2024, 8:47pm UTC](https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121/2 "2024-07-02T20:47:57Z")

</div>

Tutorials linked at the bottom cover doors.

> [@\[Tutorial\] Proper Multiplayer Linetrace from camera](https://forums.unrealengine.com/t/tutorial-proper-multiplayer-linetrace-from-camera/1229523):
>
> When I code multiplayer mechanics I do so with a few base rules. Don’t ever trust the client. Don’t waste bandwidth replicating data you don’t need to. In many multiplayer scenarios we need to execute line traces. One of the more common is for interaction. Interacting with doors, elevators, pickup items, and other gameplay actors. For these types of traces we have the client execute a line trace from their camera. If we get a proper hit result (interactive collision), then we RPC the server …

---

<div class="post-metadata">

**Author:** ![93cbbb041d664728acde881e234fed25](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@93cbbb041d664728acde881e234fed25](https://forums.unrealengine.com/u/93cbbb041d664728acde881e234fed25)\
**Post date:** [July 3, 2024, 2:30am UTC](https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121/3 "2024-07-03T02:30:46Z")

</div>

You need to make a RPC that run on server to toggle door.(Or modify your ToggleDoor event)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/9/f/29fd5218d989919552f4c6d0d40132708880c45c.png)

On your client, call the function.

 ![lol](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/7/a97078b6a1e3fff149974a64fc69434f8e6e36b9.png)

---

<div class="post-metadata">

**Author:** ![Flav-yo1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Flav-yo1](https://forums.unrealengine.com/u/Flav-yo1)\
**Post date:** [July 3, 2024, 10:46am UTC](https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121/4 "2024-07-03T10:46:53Z")

</div>

Hi Kiray, thanks for your reply, i switched on a simple try but with the same concept (switch material to a cube) on the same template Collab Viewer.  
I tried to do as you suggest but nothing happens (creating an RPC function with the same logic). It seems the client hasn’t the possibility to interact with the actor. But the server works and changes state for clients too. (Red-SERVER, Blue-CLIENT)

 ![Screenshot 2024-07-03 123536](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/6/2/16228adfda212d9f0e2ab6ec85fdae8701a645f1.png)  
 ![Screenshot 2024-07-03 123934](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/c/e/ece088a6fae93538e27f97c0f251a2ca1feee864.jpeg)  
 ![Screenshot 2024-07-03 124003](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/9/059d68777a92387dee9987f2f1c39483b8ca8352.jpeg)

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [July 3, 2024, 2:11pm UTC](https://forums.unrealengine.com/t/networking-client-server-for-a-simple-interaction/1924121/5 "2024-07-03T14:11:09Z")

</div>

In order for a client to raise RPC events, it must own the actor.  
To do this, you need to call the SetOwner function ON THE SERVER.

In my project, I made a macro that, through a component in the Player Controller, asks the server to make the client the owner of the actor in which the macro was called.

 ![Macro](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/b/7/0b7e670329f1176a71f34abcdd29f2ddfcd83aa0.png)

 ![CompOwnHelper](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/a/3da9bf307504904432946f2144e0e9e698dd3171.png)
