Hey guys,
Is it possible to copy a script from one game object to another?
For example I have a weapon which applies a freezing de-buff. I am currently just adding the freezing de-buff script then initiating the script by passing through the de-buff duration (float), sprite effect (prefab), shatter sprite effect (prefab). etc from the projectile to the enemies newly added de-buff script.
Now I know I could just put the prefab in the resource folder and have it referenced in the awake of the de-buff script to avoid passing these values through.
But is it possible to just create the script (deactivated) on the projectile, references the values and prefabs on the projectile via the editor then at run time just copy the script component from the projectile to all effected enemies.
I hope thats not too confusing!