Change the size of a Halo?

I have a halo attached to an item. The size of said item depends on a size variable. I also want the size of the halo to depend on the same variable but I can’t get it to work.

this.GetComponent("Halo").size = size;
this.GetComponent("Halo").Size = size;

Both of those fail to work, and I’m not sure what else to try. Cheers.

I believe the range and the intensity of the light also alterates the size of the halo. You can copy the light source and prevent it from rendering, but enable the halo.

Thanks, Danzou I did like you’ve said.
I have a similar prolem and I solved like this.
To create a usable from script Halo, use a Light component, set CullingMask to nothing and check DrawHalo. Putting Intensity to 1, allows you to use the Range parameter in a similar way as the Size parameter is used in the Halo Component.

You cannot programmatically set a halo’s size. You, however, animate it (it appears as a property called Behaviour.Size). So I created an animation and programmatically set the animation’s frame number to control the halo’s size.

I never try it, but maybe HaloStrenght is what you’re looking for. Unfortunatly, I think that it refers to all lights on the scene, and not about one in particular. In fact, “halo” is something referred to light, and it’s strictly dependent to the energy emitted by light sources: speaking about “size” is formally incorrect on it.

As a matter of fact, the halo item can’t be modified by script yet. HaloStrength is a bit much for most of what you usually want to do, so it’s not the ultimate solution…