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"

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. 

Gamepad event not triggering multicast function.

In a multiplayer project I have a barrier that opens up to allow the player to progress to the next area, however when the replicated multicast custom event is called by pressing X on the gamepad, nothing happens unless I am playing as the server. (When controlling the server character everything works correctly)

However when the exact same code is called through a BeginOverlap of a collision box, everything works correctly for both the client and the server. They are both able to see and trigger the barrier opening and are able to pass through to the next area.

When controlling the client character and pressing X, the "Print String" is shown on the screen to indicate the button press has been detected, but nothing happens. The barrier remains closed. The string reads "Client 1: Input Detected". The players and the barrier are both set to replicate, and the "Unlock Barrier" custom event is set to "Multicast". alt text

Is there a reason why this is only working by being triggered through an overlap instead of a button press? Again, the button press works on the server, but not on the client. Any help would be great. Thanks.

Product Version: UE 4.14
Tags:
barrier bp.png (166.9 kB)
more ▼

asked Jan 02 '17 at 08:27 PM in Blueprint Scripting

avatar image

JGock
5 1 2 2

avatar image Sean L ♦♦ STAFF Jan 03 '17 at 07:48 PM

Hey JGock,

Just by looking at the blueprints, if you're using a Switch Has Authority after your input, and the input is coming from the client-side, then I wouldn't expect the Unlock Barrier event to fire. Just as a test for curiosity's sake, try removing that check or connecting the Remote pin instead of the Authority pin.

Let me know the results of that check.

avatar image JGock Jan 04 '17 at 12:03 PM

When I connect "Unlock Barrier" to the Remote pin only, the client could press X to open the barrier, but the server saw no movement at all. When I completely removed the authority check the server could open the barrier for all players, but the client could only open it for themselves.

Maybe I'm going about this the wrong way, so here's a quick recap of what I'm trying to achieve.

  • Player (Server or Client) walks up to barrier.

  • Player presses X

  • Custom Event (Multicast) is called from Barrier BP to move the obstruction (using a timeline).

  • All Clients and the Server see the barrier move and are now able to pass into the next zone.

The reason I included an authority check in the first place was because I was trying to have the "Unlock Barrier" function always be called on the server (no matter who called it), but have each connected client see the outcome.

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

1 answer: sort voted first

I've created a simple blueprint that you can use to get your event to trigger. So in my case, I just wanted to set up movement for an actor. So on F, call my Move custom event that sets my actor location. For you, your custom event would be the one that unlocks the barrier.

You can use the screenshot below as a template to set your unlock barrier event up and then it should replicate properly as long as the actor is set to replicate and replicate movement (meaning the barrier blueprint in this case).

alt text

Let me know how that works for you.

2017-01-05.png (319.2 kB)
more ▼

answered Jan 05 '17 at 03:18 PM

avatar image

Sean L ♦♦ STAFF
43.6k 485 152 442

(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