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"

Locally using a level blueprint.

I'm trying to build a Top Down Shooter game and I want the ceiling of the room where the player is currently in to disappear and I want this to happen locally on all players connected (When player 1 is in Room 1 for him Room 2 will be blocked and when Player 2 is in Room 2 Room 1 for him will be blocked and this is happening simultaneously). What I'm currently experiencing is the map/level changes to all the players connected. Is there a way to achieve what I am saying? Thanks in advance to everyone.

alt text

Two Player Dedicated Server: alt text

Product Version: UE 4.12
Tags:
more ▼

asked Jan 13 '17 at 11:40 AM in Blueprint Scripting

avatar image

StillAlive039
182 9 10 19

avatar image Adnoh Jan 13 '17 at 12:30 PM

with an event set its replicate to multicast? not really shure what youre meaning

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

1 answer: sort voted first

It depends how you are doing what you're showing in the images. How are you triggering the change? I assume it's a trigger that detects the player pawn/character entering a trigger? If so, then it makes sense that it would change on both players because player movement is replicated on all clients, and so even on player 2's screen, his version of the trigger still detects that a player has entered the trigger.

It's been a while since I did online stuff with UE4, but logically what you would have to do is check whether the character that entered the trigger is locally controlled (meaning it's not the other player) before triggering the rest of your functionality.

You could do this either by checking that the character that entered the trigger is the same as the local player character, or by checking that the character's controller is the local controller (they should both give the same results, but the controller method is probably more robust).

alt text

capture.png (65.0 kB)
more ▼

answered Jan 13 '17 at 04:57 PM

avatar image

JeromeParent
1.2k 63 33 96

avatar image StillAlive039 Jan 14 '17 at 12:28 AM

Thanks for the information I'm gonna try what you said.

avatar image StillAlive039 Jan 14 '17 at 01:30 AM

Thank you JParent what you said worked.

avatar image JeromeParent Jan 14 '17 at 01:30 AM

Try using the Controller method instead of the character comparison method and see if it behaves the same. I assumed you used a dedicated server and not a listen server since you mentioned dedicated in your post.

avatar image StillAlive039 Jan 14 '17 at 06:58 AM

The controller method is working but it is producing some kind of error.

Error Blueprint Runtime Error: Accessed None trying to read property CallFunc_GetController_ReturnValue from function: 'ExecuteUbergraph_Dev_Map' from node: Branch in graph: EventGraph in object: Dev_Map with description: Accessed None trying to read property CallFunc_GetController_ReturnValue

avatar image JeromeParent Jan 14 '17 at 02:25 PM

Ah, yeah that actually makes sense since GetController will not return anything valid if it's not the local character, so IsLocalController will produce that error.

You can just get rid of IsLocalController entirely and instead just use the IsValid node to check if GetController returned anything. If it returns something, then it's the local character.

avatar image StillAlive039 Jan 14 '17 at 02:36 PM

Noted. A big thanks to you, truly appreciated it! :D

(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