How do I get the RGB value of a mesh at runtime?

I’ve got a static mesh which is using a dynamic material instance and timeline to change the colour. Depending on what the colour is when the player hits it will change what the mesh will do.

For the sake of simplicity, I’m only using blueprints and pure red and blue colours.

To make this work, I need to know what the RGB value of the mesh is when the player hits the collision mesh.

How would I go about finding this out at runtime?

The most simple way would be to query the timeline rather than the mesh itself. As your timeline updates, update a Vector variable too with the RGB value and when the mesh is hit, just check the value of that vector.

Personally I’d add all this within an Actor Component as it’ll be easy to reuse across many actors.

You Set the material parameter, you can Get it the very same way - that’s your colour.