Runtime material change blueprint

Hi, I need Help.
I am trying to make Reusable material change blueprint in runtime. idea is to make this blueprint and use in many projects. I have made overlapping collision box to trigger the action. there is static mesh array variable (Material Preview Sphere see in attached image ) to store small preview sphere mesh with different material applied. i want to add all the static mesh array in scene(right now its not working) when player start overlaps and hide when overlaps end. when preview mesh gets added in scene i want to click on it to change material. i have set variant manager for all the material change i want to control with this blueprint.

thanks

Let me see if I have this right. That array hold many preview spheres with different materials? When the player overlaps, you want to show all of them?

You don’t need those disable and enable input nodes. The way you have it setup, as the player leaves the volume, it will not be possible to control it anymore…

Or, do you want to show one sphere and when the player clicks it, the material changes?

yes array holds many preview spheres with different materials and is promoted to variables so that it can be set to any number of preview spheres. when player overlaps all the sphere should be visible in the scene so that all the predefined materials can be shown and player can click any preview sphere to change desired material. when player leaves the volume alll the preview sphere should be hidden . disable and enable node is for exiting game mode so that player can click on the preview sphere.

Yikes, I think you’ll find that’s too much to do in one go.

You need to understand about blueprint interfaces ( so that the player can click the ball ):

You need to find out about line traces ( the player will need a line trace and a blueprint interface ):

Then you need an array of materials and an array spheres.

Good luck…

thanks for reply but clickable part comes next after preview sphere gets added in the scene. can you help me with that part only. when player overlaps all the preview sphere of array should get added in the scene. i have put add static mesh component which is not working.

I made a level like this:

The player has an overlap BP in front of it and 3 spheres behind that. When the player walks into the overlap, the spheres become visible, and randomly change material every second ( as we have no clicking ). When the player moves out of the volume, the spheres vanish again.

The sphere BP is like this:

( The sphere component is set to hidden in game by default ).

The overlap BP looks like this:

thanks, I am trying to make something similar to this - Realtime ArchViz Interactive Loft Apartment UE4 | Darul Solutions (Download) - Yo interactive material change. i want to make all the interaction inside blueprint itself only so that i can use this in other projects as template. all the material switch is already done in variant manager.

Hi, I have prepared test scene and tried to achieve desired result by seeing various tutorials but as i m not a programmer but a designer its really hard to think as a programmer and combine various methods and achieve specific result.

inside test scene i have managed to achieve some of the functionality but far from the desired result. can i send you test scene if you can help me with that?

Many Thanks

Hi
Its been a long time but if any want needs a tutorial for our Sphere Material changer here is the link

1 Like