Base Script or Plugin Automatically Applied to Any Scene?

Hi there!

One of the issues I’ve had with unity is that it seems to me, the only way to do things is by scripting and dragging and dropping a Prefab of a GameObject with relevant scripts into a scene to do things you need it to do. However, I want to create a subset of scripts that run on any scene regardless of a GameObject with it being in the scene.

Can this be accomplished in any basic form with the C# scripting language? Or is there anyway to do it through C++ by a plugin. (I’ve never messed with that, but I do have the Pro version of Unity)

I’ve seen this here: Getting a script to run without attaching it to a GameObject - Questions & Answers - Unity Discussions

However, I didn’t see anything regarding the potential use of C++.

Any information would be greatly helpful. This is just the one thing that bothers me about Unity.

Something will need to be in the scene to start the process. You can just create a prefab with your scripts on it, then just drop it into any new scenes. That is basically how we build our games. There is one main scene, that has gameobject with script attached to it called “Engine”, that script loads and sets up everything else.

I don’t think a plugin will help, they are typically accessed from code, and really would be overkill it were possible. You could write an editor script that checks on scene load to see if your prefab is there, and if it doesn’t find it, it would add it. That would probably the best way to do it.