Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Passing a UObject derived object to an RPC function

Hi all,

I was wondering if it is at all possible to pass UObject-derived custom classes as parameters to RPC functions.

I have various use cases where this is necessary: one example is an interface I have on classes that request animations on actors: they derive from a custom Interface with a "callback", so that these objects can complete certain functions when an animations starts/completes. It is not possible to pass interfaces through, so it was suggested I pass a UObject and cast to the interface - however, the UObject always comes through null.

Another use case is that I have a custom UObject-derived class, UItem. When characters equip items, I want to make an RPC call passing the UItem through so that I can inform the server and then complete a range of logic on the server and client (update statistics, show new models, etc). However, whenever I pass it through, it always appears to be NULL afterwards.

Is there a way these objects should be passed via RPC? Is there a way to make UObjects not null? Should they be of another type?

Product Version: UE 4.18
more ▼

asked May 07 '18 at 11:43 AM in C++ Programming

avatar image

78 7 19 24

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

This is solved - I simply needed to ensure that the object had a replicated actor

more ▼

answered May 08 '18 at 11:29 PM

avatar image

78 7 19 24

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question