Randomizing car colors

By - - 3ds Max

As we are going to create a unit flow to change the color of the car we are going to edit our car units so that they all have same mesh name and same material name.

One side effect of this is that all cars will be using the same material and therefore initially have the same color.

What we did here is that open the model in 3ds Max, edit mesh and the material name, export this as fbx again and import it back. here is updated cars and previous project.

Continue from the post “Using level flow variables (2)” or download project “here” and open Level “Random_Color_Start”

In order to simplify debug process we are going to reduce the number of cars to 1 which we do by changing the values of Max_cars_,Models to 1 instead of 7 in level flow


Open car 1 in unit editor



Make sure the Car is selected in the browser

Go to unit flow tab

1.      Create a “Get Unit Mesh” node (unit- Get Unit Mesh)

2.      Hook the “Unit” of “Unit Spawned” to the “Unit” of “Get Unit Mesh”

3.      Enter “Car” as Mesh Name.

4.      Create a “Get Mesh Slot Material” node (Material- Get Mesh Slot Material)

5.      Hook the “Mesh” of “Get Unit Mesh” to the “Mesh” of “Get Mesh Slot Material

6.      Enter “Body” as Slot Name

7.      Create a “Set Material Variable” node (Material- Set Material Variable)

8.      Hook the “Material” of “Get Mesh Slot Material” to the “Material” of “Set Material Variable

9.      Enter “base_color” as Variable

10.   Hook the “out” of “Unit Spawned” to the “In” of “Set Material Variable

11.   Create “Random Unit Vector” node (Math – Random -Random Unit Vector)

12.   Hook the “Value” of “Random Unit Vector” to the “Vector” of “Set Material Variable

File Save and Run the level.

Once this is working as expectedyou can replicate this flow into the other cars by copying the entire flow and replacing the existing flow in the other car units and restore the Max_cars_Models to 7


Screencast for Randomizing  Car Colors and Here is the “Randomizing Car Colors” project and completed level to open “Random_Color_Finished” 


Posted By
Published In
  • 3ds Max
  • Film & VFX
  • Games
  • Design Visualization
To post a comment please login or register