An issue that is breaking my head - Particle System

Hello,
When my enemies hit the base I want them to increase the radius of a particle effect which is located on the base.
I managed to activate the “Shape” module and also to recognize the previous radius state… but not to change it … In order to work it out I made a script on that particular lazer (the particle effect) but still couldn’t make it work … this is the script

Thanks in advance!

Hi Rino,

What is the output in your console? What happens in the scene?

Literally nothing…
Weirdly enough it success do Debug my ‘radius’ and even calculate it with different parameters but never changes the actual radius in the inspector

Your messages are enabled, aren’t they? If so, no message is fine because that tells you that the issue is probably not in your code. Check your game object. The SunLazer component must be active on an active game object. Otherwise, the Update method will not get called.

The SunLazer script is just a test script, right know is placed on the gameObject with the particle effect. When I change the radius and print it, it shows in the console just fine, as it is working… But in the scene nothing is changing. So wierd

I made it work!
Thanks for the encouragement :slight_smile:

What I had to do was -
var sunDamage = GameObject.Find(“SunLazer”).GetComponent();
var lazershape = sunDamage.shape;
lazershape.radius = lazershape.radius + 15;

and not have a ‘var’ specific for radius

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms