ChildActorComponent reference can't be sent to Server


I need to be able to pass a ChildActorComponent reference to the server (using a Custom Event RunOnServer) when clicking on any actor but when a client click on a ChildActorComponent of a different client, it sends a None value instead.

Is it a limitation or am I missing something?

My script looks like this :

And this is what’s happening :

  1. Server is clicking on its own ChildActorComponent. Everything is fine. The receive Print is showing the Ref.

  1. Same when Server is clicking on the Client’s ChildActorComponent.

  1. Now Client click on Server’s ChildActorComponent. It still works !

  1. And the bug happens when the Client is clicking on the server’s ChildActorComponent. The Receive print is showing nothing.

Here is a zipped test project.

Ps : Unrelated, but randomly, the client won’t spawn properly…

link text

Hi Genova,

Thanks for the report! I was able to reproduce this in the test project you provided, and I’ve entered a bug report for the issue (UE-23143). It seems the Hit Actor returned for a Child Actor Component is its own Actor, rather than the returning Actor, and this reference is not being communicated to the Server as you would expect a separate Actor reference to do. I will update this post when I see any update on the report. Thanks again!

Hey Ben,

Ok, thanks for the report.

Any idea of a way to work around that problem ? Without a way to communicate that reference one way or another, I’ll be quite screwed.

I would use separate actors, rather than child components, for this. You can then attach them, if necessary.

If you’re committed to using Child Actor Components, you need to make sure the Server knows which of it’s own components to reference. So, for example, you can reference each child actor component with an integer, and use that as an ID. Then you can pass the server the integer and tell it to reference its own child actor component with that integer ID.

Hey Ben,

Thanks for the tips. It’s what I had in mind as a last resort.
Kinda dirty but that’ll do.