This is a simple blueprint which i want to change the material of my character to the on specified but it does nothing when pressed in game.
Do a check if the cast to BP_ThirdPersonCharacter fails. Try adding a print string from the cast failed output pin.
Perhaps your game mode is not setup correctly for that map? (holding a different player character)
no casting fails works it prints out after setting material but the actual material doesnt change. could it be because its a skeletal mesh?
No this should not be a problem. Are you sure you are using the exact mesh component inside the character?
yeah because i did a different test i did get material from that mesh to apply to a different one and it applied.
Does the mesh have multiple material slots?
no
As we don’t have insights in the complete setup: 6 things that could go wrong in this setup (as far as I can tell by the BP):
- The OnClicked event is never called (check f.e. by using a print statement), for debugging try using the input system with a keyboard key press (make sure AutoReceiveInput is set in the BP)
- The cast fails and the set material is never reached.
- The mesh reference is not the correct one
- The SetMaterial does not address the right material slot
- The material assigned does not differ from the original
- The shaders of the material need to be compiled (should not take more than a few seconds)
Attached an example of changing a material on the skeletal mesh of the ThirdPerson Template character.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.