SOLUTION: I had to call the function from an event graph. It did not work being called from another function. I used an event call instead.
I have a dynamic material that I am trying to change at run time. If I attach the function to the event begin play it works correctly. If I use an overlap it works correctly. However it does not work correctly when called from another script, such as after you capture the area.
Here is the code to create and set a dynamic material:
Here is the code to change the color:
When calling from the event begin play here is the result:
As you can see the teleport ring is blue and element 1 is blue which is correct.
Here is the call once the capture point it captured:
It works and changes element 1 to blue which is correct but the teleport ring stays white as seen here:
I am not sure why it works on the event begin play or an overlap but not when called from another function. Thanks