Assign Different Material to Tank Barrel

Hi,

I have created the Tank Barrel and made it Blueprint Callable. I have then replaced the barrel in my Tank Blueprint with the new Callable Tank Barrel.

However this has created an issue for me. I have deviated from the course slightly in that I have a tank Blueprint for the AI tanks and a tank Blueprint for the Player Controlled Tank. In doing this I have given the AI Tanks one look by assigning one material to their blueprint and another to the Player Controlled Tank. Therefore when you play the game the AI tanks have a different look to your tank.

My problem arises when I plug the newly created Tank Barrel from this lecture into each blueprint. I then assign a copper material to the Tank Barrel on my Player Controlled Tank thus matching the rest of the look of this tank. However this also assigns a copper material to the Tank Barrel on my AI Tank Blueprint where for the rest of the tank I have a rust material look. If I switch it on the AI Tank to rust it then switches to rust on the Player Tank.

Is there any (ideally simple) way to have two different materials assigned to the Tank Barrel that you plug in for the two different blueprints?

The only way I can see is to have completely different Tank Barrel code for AI Tanks and Player Tanks but fear this will be too complicated for me (I’m only a beginner to C++) and will create more problems than it solves.

Cheers

Chris

How are you assigning the material?

I am assigning it in the Blueprint via the Details tab under the Materials section.

And in the other blueprint you’re assigning it a different material, right?

Yes, but when I do it will change to the material across both blueprints.

So, in the two pictures above I went into my Player tank and changed the material on the Barrel to a Copper material like the rest of the tank. Then when I go to my AI tank the Barrel there has also changed to Copper and is no long the Rust material that it was previously and is assigned to all the other components of the tank.

That is rather strange. Try creating entirely new blueprints for each.

Creating a new Blueprint caused UnReal to crash when I compiled and thus lose that newly created Blueprint. However I do seem to have solved my problem by deleting the Barrel component from the Player tank and then re-adding it but using a different name to the one given to the barrel on the AI Tank.

This sounds like the bug people have had with the tracks. In which the left and right track were linked somehow, moving the position of one meant moving the position of the other.

The workaround was to delete the components and re-add them, failing that (had purple “phantom” components when doing so) was to create a new blueprint and delete the original (why I suggested making a new one).

Privacy & Terms