Download

Vehicles with dynamic lights e.g. headlights, indicators, brakelights, reverse lights

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.

29a14af8100cd3283d42e279b45d5c2433f7f8a8.png

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:

4d6e1fdb5807ad967e98d606e23c2b11.png
710a08d077e56f1a617cd420ed0191a4.png

Does anyone else have an interesting workaround or other method of achieving this?

I had moved your first thread to Blueprint section of the forum as it didnt mention C++ and what you want to do sounds doable with blueprints. You can see it here:

I’m closing this thread now as it is a duplicate.