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"

Change color(spread) based on hit location

Think of a drop of water falling into a pond.

I created a cube that changes its color when the player steps in it. Here are the blueprints I have so far:

alt text

So with this the whole cube begins changing its color at once.

What I am trying to do is simulate, as mentioned, as if it was a drop of water falling on a pond; circular waves from an origin point. That is, where the cube was hit by the player

I wasn't able to associate anything with the content I found with materials. I would really appreciate if someone could enlighten me.

English is not my first language so I am sorry for my mistakes. I hope I could make myself clear. Thanks!

Product Version: UE 4.21
Tags:
sem-titulo.png (124.9 kB)
more ▼

asked Mar 05 '19 at 09:09 PM in Blueprint Scripting

avatar image

pom bo
6 1 2

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

1 answer: sort voted first
  • place a Delay node between the Change Color event and the Timeline

  • give Change Color event a float input so you can call it with custom delay (float input from the event goes into delay node)

  • when calling Change Color in the loop, check how far from the origin the current overlapping cube is and feed the call delay value based on that distance

Completed untested but that's the first thing that comes to mind. Should work. Do tell if it does not or misbehaves.

more ▼

answered Mar 05 '19 at 09:32 PM

avatar image

Everynone
13.7k 74 25 57

avatar image pom bo Mar 05 '19 at 09:46 PM

Thank you for answering but I believe my explanation with the loop caused misunderstandings. I am sorry.

What I meant is that effect on the material of a single cube. As if there was a drop of water falling on top of it and the "waves" (color) propagate through it.

I edited the post to avoid further confusions

avatar image Everynone Mar 05 '19 at 10:15 PM

Yup, misunderstood you by quite a margin.

Still not sure how it's suppose to look since water drops don't usually have colour (no more than one - oil slick?) but I made something trippy:

alt text

edit: TexCoord is 2 | 2

Image from Gyazo

Also you, can drive opacity with one of the colours:

Image from Gyazo

capture.png (168.7 kB)
avatar image pom bo Mar 05 '19 at 10:38 PM

That is the idea! One last thing:

Say the cube is solid pink and I hit it in a specific point. This point should be the origin of the effect (in your example it is centered on the cube).

how can I trigger this effect so that it starts on that point and completely transitions to solid blue?

I really thank you for taking the time to help me. It is much appreciated! :)

avatar image Everynone Mar 06 '19 at 01:02 AM

I see. In this case, the whole thing would need to look a tad different:

alt text

The material has 2 params, Centre - where to start expanding the circle from and Radius - self explanatory. I create a hole in the middle (subtract) so the blue Radial Gradient can fit right in without blowing the colours out.


The object (the one with the cube) that receives the DropDrop call (via a custom event) runs a Timeline adjusting Radius from 0 to 2 and informs the dynamic material where the hit location is.

alt text


The hit location has to be InverseTransformed in order to get local hit coordinates of the object - these are relative to the object centre rather than any of its surfaces so I push the coords up Z by half the Component Bounds - this returns object coordinates on its top surface.

This then has to be MapRanged into values that the material can use:

alt text


This escalated quickly but it was a cool exercise. ...and can be definitely improved.

Image from Gyazo

Hope it makes sense.

mat.png (448.1 kB)
tl.png (179.9 kB)
click.png (310.5 kB)
avatar image pom bo Mar 06 '19 at 04:40 PM

That is exactly it! I was able to replicate it without many difficulties.

You were a great help and I thank you again for taking the time to do so

:)

(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