Long story short I am trying to get the scripts attached to an object in the game and transfer them to another object.
example:
after object B hits object A I want to get the script that controls Object A’s movement pattern and put that into object B. Object A has three scripts a spawn script, script 1 handles the start and everything that needs to happen when the object comes into gamePlay. script 2 handles the movement pattern of the object and script 3 spawns clones of the object (to prevent my brain from turning to mush for every object the movement script is always script 2nd (so its always in position 3 (transform, sprite render, startscript, movescript), I was hoping to do something like this
object2.addComponent(this.GetComponents<MonoBehaviour().GetValue(3)));
this works if i want to get the transform or sprite render but not for the movement or spawn script
public class ViperMove : MonoBehaviour {