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"

Replicating Parameter in a Dynamic Material Instance?

Hello! Im planning to add some features like if you press a key, your eyes get totally red and was trying to make it using Dynamic Material Instances and Scalar Parameter Values.

The thing is that works ONLY for Server/Hosting computers but clients can not turn their own eyes red, clients can not see hosting computer eye's red and hosting can not see client's eyes red.

I used typical Multicast way but have been trying tons of different things and Its impossible to make it work properly.

Can someone give me some clues? Are Set Scalar Parameter Values only able to execute from Server? Which way would you use to make this work? Thank you.

Product Version: UE 4.19
Tags:
more ▼

asked Jul 19 '18 at 02:23 AM in Blueprint Scripting

avatar image

gon.
44 2 9 10

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

3 answers: sort voted first

I would say, do t pass the MDI thrhough the RPC. Let the server and each client make their own MDI and store it in their own NON replicated variable. Only replicate the variable that is used to set the material parameter.

So you will plug the actor's OWN MDI into the setparameter node target rather than passing in another machine's MDI through the RPC

more ▼

answered Jul 19 '18 at 06:44 AM

avatar image

mightyenigma
3.7k 18 19 20

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

This worked for me. Assigned a Material Instance to the Mesh, checked the box of my scalar paremeter and just this simple thing to make it get replicated using the multicast way. Now works fine and Material parameters opens me a new horizont to work and add scars, grey hair, dirt...

Finally, solution was much easier than what I was expecting.

alt text

eof1.jpg (378.5 kB)
more ▼

answered Jul 20 '18 at 12:52 PM

avatar image

gon.
44 2 9 10

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

I have done this exact thing, byt I didnt use multicast because it disnt need to be instant or reliable. I just set a variable (which is replicated) on the server and then every tick on every machine it sets the scalar param using that replicated variable. I have a timer which every 0.25 seconds sends a Server event from the client to update the variable.

This controls the engine glow on my hover tanks across all machines. Your requirements are simpler and doesnt need to happen constantly, just turn on and off. And what you are describing that you are doing should work so please share your code or screenshots and maybe we can figure out what's missing.

more ▼

answered Jul 19 '18 at 02:31 AM

avatar image

mightyenigma
3.7k 18 19 20

avatar image gon. Jul 19 '18 at 04:33 AM

Sure, I have tried tons of things so I tried to clean all and place the main code in BP. The thing is that Character BP starts empty with no Material associated to Mesh and pop up an Animal Menu. Once you select a Bear, creates a dynamic material instance of Bear_Material and Set Material to the Mesh. I can see the Material of the Bear on clients and server. The thing is that I can not replicate the parameter change value as I wanna to.

After SO many changes, maybe now Im missing something or any step but this could be a start point. Thnx.

alt text

option1.jpg (518.3 kB)
(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