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"

Multicast being called before replicating variable

so i just found a very simple problem with replication and multicast... when setting a replicated variable and calling a reliable multicast after it, the multicast gets called on clients but it isn't using the new replicated value, like if the multicast got called first even tho i called the set node first alt text

To fix this i had to add a delay between setting and multi-casting, but it isn't a fancy solution and i don't like it. Another way to fix this is to uncheck the RELIABLE box from the multicast but i also don't like that

i tried calling the multicast first and then the set node but when i do this unreal crashes instantly, i tried it 2 times already.

am i doing something wrong? or is this a bug and should i open a ticket?

Product Version: UE 4.20
Tags:
sin-titulo.png (83.2 kB)
more ▼

asked Aug 27 '18 at 07:57 AM in Blueprint Scripting

avatar image

Nico_Pucho_27
73 4 11

avatar image Nico_Pucho_27 Aug 27 '18 at 05:34 PM

no answers?

avatar image NijoMeister Aug 27 '18 at 06:19 PM

Hi, Nico_Pucho_27! Could you show me the Multicast function you are running? Thanks!

avatar image Nico_Pucho_27 Aug 27 '18 at 06:27 PM

sure! it simply hides an array of static meshes and then only shows one of them alt text

the problem is that it shows the previous current mesh and not the new one

sin-titulo.png (202.9 kB)
(comments are locked)
10|2000 characters needed characters left

3 answers: sort voted first

Hi again, instead of getting the variable 'Currentgun' normally try to get it through the function, Hope this helps :D

more ▼

answered Aug 27 '18 at 06:30 PM

avatar image

NijoMeister
70 8 10 15

avatar image Nico_Pucho_27 Aug 27 '18 at 06:34 PM

you mean adding the variable as an input of the function?

avatar image NijoMeister Aug 27 '18 at 06:35 PM

Hi, Nico_Pucho_27! That is exactly what I mean! :D If that doesn't work then there might be a problem with setting the variable, however that is very unlikely.

(comments are locked)
10|2000 characters needed characters left

RepNotify is what you are looking for when you want something to happen when the variable is changed. The caller is not responsible for when it arrives so just because you call it in order doesn't guarantee it arrives in that order. It is not a bug it is just how networking works.

more ▼

answered Aug 27 '18 at 06:41 PM

avatar image

GarnerP57
381 1 4 6

avatar image Nico_Pucho_27 Aug 27 '18 at 06:44 PM

so multicast functions haves more priority than replicated variables?

avatar image Nico_Pucho_27 Aug 27 '18 at 06:47 PM

and what if a variable is = 0 and i set it again = 0? the engine is not notifying the players because the variable didn't change, but i still want to execute the code inside the On Notify function

avatar image GarnerP57 Aug 27 '18 at 06:49 PM

In that case you want to use only the Multicast with the variable as a parameter and not RepNotify

avatar image Nico_Pucho_27 Aug 27 '18 at 07:00 PM

thanks! could you take a look at this question too? https://answers.unrealengine.com/questions/821713/view.html

(comments are locked)
10|2000 characters needed characters left

Pass the CurrentGun through the multicast event as a parameter, set it on the handler side and then use it normally as you have it. That will sync the variable to be the same as what you set it to before calling the multicast at the moment the multicast is received.

more ▼

answered Dec 07 '18 at 01:08 AM

avatar image

mightyenigma
3.4k 16 17 12

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