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:

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.

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

  • 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.

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! :slight_smile:

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:

edit: TexCoord is 2 | 2

Image from Gyazo

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

Image from Gyazo

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

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.

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:

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

Image from Gyazo

Hope it makes sense.

1 Like

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