Actor Component Replication?

Hi all,
I’m working on a VR LAN project. I managed to spawn the players and see each other’s movements. I even made the standard pickup cube replicate it’s movements. The BP_PickupCube is terrible so I created an actor component to replace the code from the BP_PickupCube and then just add the component to whatever I want to grab. It works! But there is where the problem comes up: As a server/Has authority I can grab and manipulate the objects that have the component. As a client/has no authority, I ALSO CAN DO IT, But I can’t see! On server’s side I can see the client interacting with the objects but the client who’s grabbing the objects can’t see what he’s doing.
I don’t know what I am doing wrong. Any help?



Hey there!

I usually don’t work much with Replication but my suggestion would be that you check the “Component Replicates” Checkbox and try it afterwards?

image

Here is the link to the docs regarding Component Replication, there should be a better explanation under “Blueprints”.

Have a great day and I hope this solves the issue ^^

Thanks for replying. I’ve ready it already and it didn’t solve the problem. I tried to store the static mesh from the owner of the component in a variable, and set the variable to replicate. Still got the same result… :x

No worries!

Where do you use the Actor Component?
Do you put it in another Blueprint Actor? (if yes check if the “Replicates” thingy is checked there, don’t know if that changes something but it’s worth a try)

I’m adding it to static objects on my scene. I mean, that’s an archviz project and sometimes it’s nice to have more objects you can grab. So that’s the reason I created this component, it’s pretty handy. I tried it before on single player and works fine, but now only the client that despite is sending the right info to the server, can’t see what itself is doing.
Another thing I just noticed, I can’t teleport to the place where the object were before moving it, that happens with both server and client.

Sounds easy doing it that way and flexible.
You are also probably using the right Net Mode, so I am pretty clueless right now.

I don’t really work with Replication so sorry for that.
I will look into it and try to get something working on my end but yeah sorry again ^^

Hey, don’t be sorry! Any suggestion helps
I’ll keep trying here too, whenever I find out the problem I’ll bring it here.
Thanks for the help!

1 Like

This is very tricky, but managed something similar. I’d have to look back, but I believe I had to use a owning client function that calls the server functions and in combination with Multicast RPCs. You’ll have to setup and run the client side functions (run on owning client) in tandem with the server functions or one or the other won’t see the replication.

Solved!
The code is correct, the problem was: I was setting the object mobility on the Component BP, so despite it was being called on the server and then multicasting, somehow only the server could see it even the client being able to grab the objects.
I had to set the mobility manually on the object, that solved the problem.
Thanks for your answers!