Recently I made the switch from Unity3d to UE4 and have been finding it increasingly difficult to recreate what i had in Unity.
What i want to have is multiple vehicles that have each have headlights that can be manually turned on and off as well as reverse lights that come on when reversing and brake light that come on when braking, etc. you get my flow here.
At the moment i am trying to have it so that i have a base CarLights material that has the material logic all in there then i have one material instance for each car (e.g. bmw 5 has BMW_5_Lights) which has the CarLights material as it’s parent then from that material i have more instances such as headlights, brakelights, etc that have the BMW_5_Lights material instance as their parents. this way all light materials for each car can use one texture and i can change the emissive intensity individually.
This will cause an issue when you have more than one vehicle as modifying the parameters for one BMW 5 will change the material which will be applied to all of the BMW 5’s in the game.
Another way i thought of was to have mesh components on the car’s actor and enable/disable them i could import the light meshes seperately and apply them in my initialization function, this would be a good way to go as i could put light components as children of the mesh components but i dont want to have to import loads of meshes for each car considering there will be loads of cars ingame. This is essentially what i did in unity as you can see in these to screenshots:
Does anyone else have an interesting workaround or other method of achieving this?
P.S. i dont mind if the resolution uses blueprints or c++ but please note i will have to use c++ to do this eventually so blueprint only solutions wont work