Problem with replicating "On Begin Cursor Over"


I ran into a problem where, for some reason, this event is not replicating as intended. The logic should highlight the object when it is being looked at, but for some reason it lights up for all clients only if the server is looking, and if the client is looking, then nothing happens for either the client or the server. Does anyone know what the problem might be?

Hey,

What Object is this you are showing? If this is on a Widget then that should be Client side only and therefore no Replication can happen inside of them.

The Unreal network Compendium is great for learning Multiplayer and Networking - Multiplayer Network Compendium | An Unreal Engine Blog by Cedric Neukirchen

No, its a object on a level, not widget. So I need to replicate it.

It’s a matter of ownership. The item is spawned on the server → hence the server owns the object. You would need to call the server function from an class that you own => player controller or currently possessed character. They in turn can interact with the object via a function and trigger it’s change on the server => which in turn can propagate to the client either by RPC or through a rep_notify if bound to a variable change .

Set the owner of the hovered object inside of your player controller through a server RPC to your own controller (pass it in) and then do an rpc call from the client.

Tick Version

Project 5.4
MpCursor.zip (64.2 KB)

Video in action

item

interface

Cursor Over Version


Edit : Alternate code if you want the cursor over functions

Inside of controller

interface

Functions

inside of actor

Updated scene:

Ball uses overlap method, Cubes use tick. Upon tick disconnect the less intense version should work

MpCursor_cursorWInterface.zip (87.6 KB)

wow, thank you so much. I will try it. And again thanks to everyone for your time