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. 

Is locally controlled returns false for listen server host

As said above, when i'm using Is locally controlled node, it returns false for listen server host, and it makes game unplayable for hosts, but each other client, connected to this server, works perfectly well. What can i do to make game playable for hosts? NOTE: using OR with is dedicated server+not is working bad, it makes game buggy for each player on the server.

Product Version: UE 4.16
more ▼

asked Oct 08 '17 at 08:51 AM in Blueprint Scripting

avatar image

21 3 4 7

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

1 answer: sort voted first

Late-ish comment and it might not apply to how/when you're using it, but I just had this problem my project too. In my case, I have a radar collision capsule on my player. Whenever an object overlaps this capsule, it checks if that pawn is locally controlled and then does some checks to see if they should be added to an array to be displayed on my radar. I'm using locally controlled so only the player pawn has to bother with these checks and radar arrays (as of course, another players radar array doesn't matter to the player).

When I started the game, the host didn't have anything on his radar when he spawns in, but if he walks out of range then back in range of an object it displays on the radar. My client worked 100% fine though. After a bit of investigating, I found my host was returning that his pawn was not locally controlled, so for the first tick of the host's pawn being alive, the host believed he wasn't controlling it and therefore did not get anything from the Overlap events for my radar. So I thought "Ok, I'll just make a function that checks and adds anything in range to the radar and pop it in BeginPlay so after spawning in, he'll get the actors he's missing" but this doesn't make any difference.

Here's the issue: when the host spawns a pawn and possesses it, there seems to be a tick or 2 where, according to himself (host) he isn't possessing it, so any events or functions that would occur during those frames (like my BeginPlay or EventOverlap which also does a check when the actor is spawned) would not go through since I gate them behind this LocallyControlled check.

Fortunately in my Game Mode BP, after spawning a pawn for the player and having them posses it, I call a custom event called OnPawnSpawn. I just stuck in my quick radar check function in there and it worked fine for my host.

So I'm not sure how or when you're using yours, but from what I've gathered I have a feeling you're using it in a BeginPlay event or some other event that is called on the same frame as BeginPlay. If this is the case, you should be able to fix this by having a small delay after spawn. Like I said, for some reason the host can't seem to posses an actor on the same frame as it's spawn (I think). Thinking about it, you could also use OnPossessed too for this.

If you're getting False AFTER these frame 1-like events then unfortunately I'm not sure, unless of course you've made some silly mistake where you aren't even possessing your pawn. Double check your BPs/code if thats the case.

more ▼

answered Jan 12 '18 at 02:36 PM

avatar image

56 1 6 9

(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