Change texture from another trigger

Hi.

First, I’m trying to study this blueprint scripting. From my experience, jumping into an actual real project is the best way to deal with most of the steps you will find on the way. Being said that, I’m trying to follow a lot of tutorials I’ve found around here… but I’m still missing something.

I want to change the texture of a given static mesh from a trigger placed somewhere else (trigger volume), As I’m still trying to understand the concept of the blueprints, this is my guess:

  1. Place a StacticMesh (a sphere i.e.)
  2. Give him a material and a texture (red i.e.)
  3. Convert the Sphere to blueprint class actor
  4. Create a trigger Volume (a cube)
  5. Convert it to blueprint
  6. Add an Actorbeginoverlap
  7. If that’s true: set target to Sphere and Set texture of Sphere to green i.e.

That’s my logic, but of course, is wrong. Could someone show me the path to it (at least a little explanation about how to target other meshes or actors from outside)

Thanks!

you can actually do all of that in the level blueprint if you wanted to (see picture below for a example of changing a texture parameter). in the given example theres a begin overlap of the trigger then it makes sure that it was the player character that was overlapping. then it moves onto the changing of the texture. to change a texture you will need to have it as a parameter in the material then you will need to create a dynamic instance of the material, then you can set the parameter. the picture shows how this is done.

another option would be to have the trigger and the sphere as one blueprint actor. in this case you would create a blueprint actor then add in a static mesh and a box collision then do the scripting in the event graph of that blueprint.

as a last option you could convert either the trigger volume or the sphere to a blueprint and write the scripting in there, but in this case you will need to get a reference to the other for it to work. given the example you gave the easiest method to get a reference would be to have a variable and make it public so it can be edited in the details panel of the scene, then you can set the variable to the instance of the object you need.

as you can see there are many ways to accomplish what your looking to do if you need more help let me know. just pick a method and i can walk you through it. oh also there are ways to have combinations of these methods as well.

Hi, ThompsonN13.

Thank you very much for taking the time to answer me. One of the things that really blows my mind about Blueprints are the thousands of options available to achieve whatever you want to do. I have some programming background, and I know for sure that all is about the path you want to choose… according to your imagination and skills, of course.

About this problem, your solution works perfectly and that gave me a good starting point for figuring out the rest.

Thanks!