How do I pass objects via NetMulticast

Ok so my question is how do I pass an object from the server to the client via a net multicast.

What I mean is; I have a {float, Vector, Vector}, that gets passed around a few functions on the server, before ultimately being passed on to the client.

I’m trying to tidy things up, and make a type out of my {float, Vector, Vector} as it’s a pretty common bit of data. I’ve tried to create is as a struct, and as a child of UObject

USTRUCT(BlueprintType)
stuct MyObject
{
  GENERATED_BODY
  ....
}

CLASS()
class MyObject : UObject
{
  GENERATED_BODY
  ....
}

But each time I get wacky results on my client (usually a null pointer on accessing the object in the client). I also have issues accessing the struct from a blueprint.

What is the proper way to do this?

1 Like