I instantiated a prefab in a script. The GameObject that is created doesn’t have any of the components from my prefab in the project view. My prefab is suppose to have a rigidbody and a box collider but when I instantiate it it has neither. I tried just creating them and setting them to the ones they should be but it’s telling me the value I am trying to take them from is a read only variable(a global variable set to a gameobject in project view). I tried creating the whole thing in the script but then I couldn’t find a way to edit the box collider size and center variables. A way to do that would allow me a work around but a solution to the problem of the prefab losing its components would be ideal. Sorry if this question appeared somewhere else but I looked and couldn’t find it.
I was trying to instantiate it using a script with it as a variable in the script (in the project view). I got around it with kind of a hack job of making an actual version of the prefab in the hierarchy off camera and instantiating that. Seems to be working fine.