Is constantly adding and removing components bad?

I have a status_Poison script that is attached to a game object when it is poisoned that ticks, deals damage, etc. Once the duration is up, it destroys itself (the script component) and the little poison bubble. The next time the game object gets ‘poisoned’ it adds a new status_Poison script and goes through it again.

Other statuses I’ve added work the same way, so the game object could potentially be adding/destroying components every second.

Basically my question is whether or not this is a bad thing to constantly destroy/add the component. I could go about the poison another way but if there isn’t anything wrong with it I won’t.

No, there is nothing inherently bad with doing what you do. In fact, in my opinion this is the way the Unity system should be used. The scripts are afterall inheriting from Behaviour, and as such, should depict a behavior. AddComponent is just as expensive as instantiating a new Object with the new keyword. (Well, Unity does do some work behind the scenes, so it’s a tiny bit more expensive.)

The only downside I see with this approach is that if you have lots and lots and lots of GamoObjects adding and removing components every second you might get lag, not from the instantiating, but from a Garbage Colletion run. You could consider Object pooling as explained in the link.