does anyone know if there is a free script or plugin or something that allows you to pre-select a set of scripts and simply select an object and load all those scripts onto the object at once, instead of having to drag each script onto an object to create a new prefab?
you could write a very simple script to do it for you. I would attach this script to the main camera
AutoScript.cs
void Start()
{
foreach(GameObject obj in FindObjectsOfType(typeof(GameObject)))
{
switch(obj.tag)
{
case "example1":
obj.AddComponent(typeof(Script1));
obj.AddComponent(typeof(Script2));
break;
case "example2":
obj.AddComponent(typeof(Script2));
break;
}
}
}
alternatively you might want to use layer, or name, or whatever your preferred identification method might me
you realise you can instantiate prefabs right and they are created with scripts? What you are trying to do is basically one of the main purposes of them!
thanks guys, actually i found what i was looking for here: Unity Asset Store - The Best Assets for Game Making
it’s a component copier, basically if i have a prefab already setup with 10 components lets say, and i want to setup a new prefab that uses all those same components, but the actual charactermodel is different, so i can use this tool above only $5 to copy and paste all the components from one prefab to another…
this is extremely useful (time saver) for setting up new player models, or bot models for your game, rather than having to drag 10 scripts (components) to a new gameobject(player model, or bot model).
also. all the values of each of those components can be copied over as well! so you don’t have to go it and tweak each and every script (component) esppeically if there are some things that are in common (the same) across the board with the player model or bot model setup.