Search the Community
Showing results for tags 'parent gamobject'.
Found 1 result
I have a gun script in which I have declared Now I wanna assign the weaponCamera of gun script from its parent's parent's to its parent(MainCamera). Means like this FPSController>Lean(empty gameobject)>MainCamera(i wanna assign this)>Body_1(gameobject)>Arms(gameobject)>M4A1. FPS controller>Soldier. I dont wanna assign camera manually to inspector because I instantiate clone of m4 gameobejct. Similarly I have declared I wanna assign this gameobject from FPSController's child to GameObject of GunScript.(public GameObject Soldier;) I know the question is pretty hard(or may i dont know how to ask questions like this). I tried various codes like : But it didnt work! Im stuck w/ it since Monday. Don't make comments on my english. NVM!