Blueprint communication for "create dynamic instance material"

blueprint - The closer we get inside the radius, the more the value drops on the parameter posted by anonymous | blueprintUE | PasteBin For Unreal Engine
So I have my player character, a cube, and a sphere.
In the event graph of my cube, I wish to create a dynamic instance material that can change a scalar parameter from the material of my cube when the player character gets close.
Problem is, that doesn’t work, but when I have all that logic in my player character, exactly same setup, it works. So my question is, is this a limitation on how blueprints can communicate, or did I miss something?

For more context, I also had a sphere in the scene, who shares the same material as my cube, and I tried to change the scalar on that material when player got close to the cube. For the sphere it works, for the cube it doesn’t, even tho I’m trying to influence the exact same scalar parameter on the same material.

Share your BP for us to help.

1 Like

The closer we get inside the radius, the more the value drops on the parameter posted by anonymous | blueprintUE | PasteBin For Unreal Engine - here it is. The logic is "the closer we get to the center of the radius, the value of the parameter keeps dropping from 1 to 0.

At first glance the only two potential issues I see are:

  • Material instance not applied to all components.
  • Character cast failed.

Here is a few suggestions:

  • If you want to know if it is the player character (possessed pawn) that is overlapping, you can do so by comparing references rather than casting.
  • If you want to search in a radius, use a sphere component set to Overlap rather than a trace. Shere comp will capture everything witin a radius and it’s event driven rather than checking every tick. If your player is spawning inside the radius then turn on Generate Overlap Events During Level Streaming.
  • Might be best to toggle Tick assuming it will do nothing when the player is outside the radius. Also reduce the tick interval…
  • Since both components have same material instance, only create 1 dynamic instance and apply it to both. Then only set the parameter to the one.
  • Use variables and parameters names without spaces.
    image
Here is a BP with the proposed suggestions:


RadiusSphere

Hope it helps.

Thanks for replying to me homie, I managed to fix it. I had to make a fresh blueprint, I copied the code over. I’m not sure exactly what the problem was tho…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.