Change material att by animated object position

I need to change color/intensity of a light (randomly if possible) by X axis position of an animated object. Trigger box isn’t a option.
I searched for similar cases and blueprint first steps, but got lost about everything. Someone can any idea?

The question is a bit vague:

you say change material att but then change colour / intensity of a light - which one is it? Also, how is it supposed to be random if its based on another value? Perhaps you want to add some random value?

Here’s light colour and intensity:

Above, you could read the location of the actor rather than the value spat out by the timeline instead.

Image from Gyazo


If you wanted to push a value into a material, you’d need to have an exposed parameter, create a Dynamic Material Instance and assign it to a, presumably, mesh.

Yes, I would like to add a random value, triggered by “X” translate value.
I really needed to read the location of the actor as you said, but couldn’t figure out how to do it - the correct node, and how to associate my object to it.

You will need to be waaaay more descriptive than this.

add a random value, triggered by “X” translate value

What does this even mean? Add it to what? What is being randomized? Distance? Light? Colour? Is it every frame or is it event driven? Does it accumulate? What generates this value? The actor in question or it’s being fed from outside?

We could go like this all day :slight_smile: Perhaps you want to describe the end goal / effect. How will this look from the player’s perspective? All I’m imagining atm is that you’ll have swinging chandelier… :smiley:

[…]read the location
of the actor as you said, but couldn’t
figure out how to do it - the correct
node, and how to associate my object
to it.

Each object knows its own location thanks to the Get Actor Location. Anything else can query that value as well, and in the very same manner.

I’m noticing I will probably need to refine what I really need. It’s not for game, I’m pretending to do produce a videoclip. I’ll take some time digging in your points and wait for more directed issues.
Thank you very much!

Side question: is it possible to import animated curves into Timeline node? I’m still pretty much lost about the BP workflows and could copy your solution, but would be impossible to keyframe everything inside UE4.

The curve functionality exposed to the BPs is limited, verging on basic. You can load a predefined curve into the timeline, sure:

But when it comes to importing data, you’d need to rely on the curve tables and evaluate them (bottom left).

There is a (paid) plugin on the marketplace that expands that functionality - can’t recall the exact name but curve is a part of of it - should be easy enough to find.

animated curves

Not sure what that means. What’s the format of that data? How is it animated? I want to say no but I’m not sure.

I can’t thank you enough!

Alright, I finally discovered it. I have to check “generate overlap events” in collisions details for my mesh to activate the change.