[Question] How to change materials for vehicle at runtime?

I have a WheeledVehicle Blueprint in which i want to change the materials at runtime. However since its a [ROOT] mesh i cant seem to find a way to change materials at runtime. There is a Mesh Variable inside Vehicle group but i cant use it. When compiling it says Pin Target must have a connection and the target only accepts Character.

I also tried setting the Mesh to None in [ROOT] and added a new SkeletalMeshComponent and tried using it. But then the vehicle wont move. :frowning:

So is there anyway to change materials at runtime for a WheeledVehicle?

Hey Satheesh,

Thanks for your report! Would you be able to post a screenshot of your setup for how you’re trying to change materials?

Thanks!

-Steve

Sure thing Steve! Its a very very simple setup like this. I dragged and dropped Mesh node from My Blueprint and compiled:

As you can see the Target for the Mesh node is expecting a character and since the vehicle is extended from Pawn am not sure what to do.

Hey Satheesh,

It looks like there is an issue with correctly referencing the SkeletalMeshComponent in the WheeledVehicle blueprint class, so I have filed a defect to investigate and fix. If we find a work-around in the meantime, I will update you with that information.

Thanks!

-Steve

Thank you Steve! :slight_smile: