The thing is i’m making a multiplayer game and to avoid players having components mix up i have to disable them in the prefab and when i instantiate each one of them i enable all of his components , and i have a child called “Main Camera” , when i try to enable it it doesnt work.
and for the Main Camera i attached a “Gun” child , when i tried to enable it’s components it didnt work as well…
i’m not sure i got that… instantiating the components (if possible) would be awesome and will work i guess , but i didnt get what does it have to do with the script you added it’s basically what i did , but i got what you mean … i’ll try that out
If you plan on using the components again, then store them in variables.
Constantly using GetComponent is slower and more intensive than getting a reference to the Component.
Doh09 and TonanBora thanks a lot both of you , i tried your ways(Adding a component) but didnt work , but what i did at last , i deleted the main camera after deattaching the gun from it , and added a Camera Component to the player , and when i instantiate the player i simply enable the camera component and the gun’s components:) … yeah as simple as that i feel stupid:smile:
Yes, but now you have another problem.
Now, your camera will not rotate unless the player rotates, which means no looking up, or down, unless your player physically rotates up, or down.