Is there any way to assign a script to a game object with code? I’m asking because currently with how my “Spawn an object into the game” system is coded, I have to have two seperate objects, each having a script for AI and the other having a script for if that ship was used by a player.
Here’s an example of what I mean. (EvE models, heh )
One of the two ships has a script for player movement, etc, while the other has a script specifically for AI functions.
What I want to do is use one object, spawn it into the game, then assign the appropriate script. Any nudge in the right direction would be appreciated… however, I’d prefer if you don’t post something along the lines of “this is how you do it” because I like to learn how to tie the API together in new ways and don’t feel like I learn anything if someone tells me exactly how its done.