Hello there, I have a script for creating the object and another one as the duplicated object which is supposed to change the color of the object however the script does not change the color at generation. it changes color to the wanted value only after an interaction happens.
private UnityEngine.Color originalObstacleColor;
[HideInInspector] public int life = 1;
UnityEngine.Color colorGet()
{
if (life <= 10 )
{
return UnityEngine.Color.blue;
}
else if (life <= 25)
{
return UnityEngine.Color.cyan;
}
else
{
return UnityEngine.Color.green;
}
}
void Start()
{
originalObstacleColor = colorGet();
}