It is necessary to change the size or color of the halo . Unfortunately, the manual does not say how to do this from the code.

Behaviour myHalo = (Behaviour)GetComponent("Halo"); 

Allows you to only turn it on and off:

 myHalo.enabled = true; myHalo.enabled = false; 

When trying to set a color:

 myHalo.color = Color.magenta; 

displays:

"Behavior" doesn’t contain a definition for the argument color dire

  • let me do it: Halo is a subclass of Behavior, which means you need Halo myHalo = (Halo)GetComponent("Halo") , no? - Alexander Pozharskii
  • @AlexanderPozharskii What, sorry? In this form, it is not even defined. As indicated in the post, the appeal to the halo works successfully. Only appeal is enable or disable. The question is, is it possible to somehow change the color on it from the script? - Dmitrii

1 answer 1

Without waiting for an answer, and looking at English-speaking sources, I regretfully acknowledge that there are no ways to change the color of the halo from the script yet. But, there is a workaround - we add a light source instead of a halo, click Draw Halo there, and from the script we treat it as follows

 this.GetComponent<Light>().enabled = true; this.GetComponent<Light>().color = Color.magenta; 

The color changes successfully. Similarly, you can change other properties of light.