I am trying to change collidesWith paramater of an particle system inside of a script but i am getting this error:
Error CS1612 Cannot modify the return
value of ‘ParticleSystem.collision’
because it is not a variable
My Code:
GameObject ammo; //Game object with ParticleSystem on it
public LayerMask desiredLayers;
private void Start()
{
ammo.GetComponent<ParticleSystem>().collision.collidesWith = desiredLayers;
}
Now my question is what is the correct way to change the layers of a particle system collide with.