So I have a bit of an issue. I have coded alot of actions that the player can do based off of my original enemy, Enemy A. But I now want to make a new enemy, Enemy B. But right now, my player script is coded right now to mess with the movement of Enemy A by accessing it’s movement component and setting its speed to -1 (to make the enemy run away).
But the problem I have, is that Enemy B’s movement pattern is different from Enemy A, so I have to make a different movement component for Enemy B. But now I’m in a bit of a pickle because, the players actions are coded to access Enemy A’s Movement script called “Follow.” But I also want the player to be able to change Enemy B’s script called “Charge.”
Is there anyway for me to stream line this process? So that my player can change any enemies movement script, without having to hard code in the unique name of each script? Can I use like prefab varients or something like that? I’m new to unity, but really love coding. I’ve just been so frustrated with issue… Any help would be greatly appreciated!