- Home /
Car Model Run time Color Change Problem
As I instantiate car 3d model in the game, I have provide functionality to change car color as per game play choice. But this is not working because 3d model creating own instance of the material. You can see this in the following image:
I have created separate material for this purpose and changing its color but run time it didn't get affected. If I close the game and then start again then my car getting last given color but not on the spot.
Code for changing color of car material:
carsChasisMat[GameManager.Instance.PlayerCarIndex].color = DataCollection.CAR_COLOR_OPTIONS[colorIndex];
DataStorage.StorePlayerCarColorIndex(colorIndex);
colorIndex++;
colorIndex = colorIndex >= DataCollection.CAR_COLOR_OPTIONS.Length ? 0 : colorIndex;
Debug.Log("color index: " + colorIndex);
Before it was working properly when I was implemented but today it's not working. Give me suggestion for this so I can change my car color at run time.
Your answer
Follow this Question
Related Questions
What is the best way to have different colored material on a batch of the same 3D object? 1 Answer
Using Color.Lerp with Lightweight Render Pipeline 1 Answer
Material color won't update! 2 Answers
Object with an extra material is blending the extra one with another! 2 Answers
Changing Material Color Via Script 1 Answer