x

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"

Calling RPC functions from inside UObjects, Is it possible?

So say i have an actor that contains a uobject class within itself, and this uobject is properly replicated around along with the actor itself is also replicated.

I managed to do variable replication of the uobject variables ( thankfully ) BUT what i want along with the variable replication is the uobject itself calls a function that will be run on server ( for validation purposes ) instead of me needing to use the actor that owns it to run a server call. Any help is appreciated

Thanks in advance!

Product Version: UE 4.10
Tags:
more ▼

asked Dec 29 '15 at 09:10 AM in C++ Programming

avatar image

Phreak Idunnoe
11 1 2 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

It should work. You should, technically, be able to run an RPC on any replicated object that the player owns.

more ▼

answered Dec 29 '15 at 03:46 PM

avatar image

TTaM
1.7k 79 28 81

avatar image Phreak Idunnoe Dec 30 '15 at 12:30 AM

Sorry for the late reply, i kinda tried this on my side although the debugging is telling me that even though I'm requesting to the server the client is doing it. The server never actually runs it unless i ask the actor to do the server function

avatar image TTaM Dec 30 '15 at 12:33 AM

The client should never run a server rpc. Are you sure it was the client? How did you tell?

avatar image Phreak Idunnoe Dec 30 '15 at 12:51 AM

Thas why i was rather perplexed, it shouldn't even be possible, though i ran simple debug which runs GetNetMode() on that function. if i were to call from the Actor i get a true for server, but if i were to call it internally from the object, it says client

avatar image psychogony Jan 01 '16 at 12:03 AM

In the current ue4 model, only APlayerControllers on clients can make RPC calls. You may wish to consider a different approach.
More here https://answers.unrealengine.com/questions/209092/networking-rpc-client-server-ownership.html

avatar image Sashka Jun 14 '16 at 11:57 AM

I've set up my UObject derived class properly (like recomended here). And property replication works good, BUT I can't call RPC on this object. On server side I've tried to call method marked as UFUNCTION(NetMulticast, Reliable). And it didn't work. When I rederived this my class from UActorComponent instead of simple UObject, this method started work. What have I missed? Why didn't it work? (I've post this as separate question)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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