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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Controlling an Actor using a widget from a Client.

So I'm trying to call Server functions on an actor from a widget on a Client machine. The problem I'm running into is that the actor doesn't have a valid owner to call the Server functions on since it's just being placed in the level and doesn't really "belong" to anyone.

I've read through all the documentation I can find on Networking but can't seem to find the right answer. So I know all the really obvious stuff (setting bReplicates to true, making the component replicate, setting the UFUNCTION to have "Server", etc).

I've tried using "SetOwner" to set the owner to the Server's pawn... however when I go to call the function it doesn't work because there isn't a valid "controller" on the client machine. Thus the red X on the diagram where the function call doesn't work.

I know I can reroute the input to go through the player controller but I'd rather not since I'll have several different ways to interact with the environment and it will quickly become cumbersome.

Is there a way to correctly set the owner on level actors so I can call server functions directly on the object without going through a player controller?

alt text

Blueprint Example: (This is pretty much exactly what I'm doing code side which also doesn't work)

The widget grabbing the only actor in the space and calling the server function on it. alt text

Here's some basic implementation where it should be rotated. All of the replicated flags are set and this works on the server... not so much on the client. alt text

Product Version: UE 4.7
serverclient.png (12.1 kB)
capture2.png (68.2 kB)
capture3.png (55.4 kB)
more ▼

asked Jun 17 '15 at 08:08 PM in C++ Programming

avatar image

11 1 4

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

1 answer: sort voted first

Ended up finding my own solution and posted an answer here: https://answers.unrealengine.com/questions/242055/cannot-call-server-rpc-from-clients.html

more ▼

answered Dec 06 '15 at 04:23 AM

avatar image

11 1 4

(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