Cause a function to trigger by hitting a material UE4

Hey people,

Does anyone know how I trigger a function by overlapping my Mannequin actor onto a material assigned onto a mesh? For example, my actor steps onto a scaled in cylinder with textures on the top-sided face, and when I stepped onto that texture, a function will trigger boosting my character’s speed/jump velocity.

An example Blueprint will be “While my character is on top-side of Cube, and the Cube’s material/texture is set to the assigned texture, the Character’s speed will boost up.” I think this has something to do with the Event Dispatchers but I’m not so sure. Can someone please help? Thanks.

It would be a lot easier if you just had different sorts of cube blueprints. Some that made the player jump higher, others that didn’t. You can still give them different materials so the player knows what’s going on.

Dispatchers would not be the way to go. Just code in the cube BP.

When the character is going to jump you can just do a line trace to the floor and see if you’re standing on a magic cube. If yes, big jump, if no, normal jump.

Hit Events don’t return materials; however, they return Physical Materials. So you can assign different Physical Materials to your materials and use them to determine what to do.

Make sure to check “Return material on Move” in the Character Capsule Component details in the Collision section.

Another thing to keep in mind: if you use your material on top of an object, your hit event will only fire when you land onto it. When you just stand there or move along the surface, there will be no hit events. So in this case you can use, for instance, trigger volumes to see if the character is on top of an object.

However, if you plan to dynamically change materials like it was done, for example, with gels in Portal 2, you can’t really use trigger volumes, because you don’t know where the material will be applied. In this case you can use line trace downwards, as suggested by ClockworkOcean, to see what physical material you’re standing on: