instantiate a prefab. can it be done without dragging the prefab to the script in the editor?

just curious. can you use a line of code to locate the prefab instead of making a public variable which you then drag a prefab to.

Basically it seems like it should be possible.

My issue is i’d like to have a prefab in a script and i’d like that script to be added dynamically to an object (as such since it isn’t currently part of the object, the component will be added during runtime, too late to drag a prefab in).

Put the prefab inside a ‘Resources’ folder and use Resources.Load.