So I have a tank that has several parts. These parts are assigned to variables as game objects. I currently have the tank in the hierarchy in the scene. I manually assign the parts to variables. I would like to put the tank as a prefab. Then instantiate it, assign its parts to variables and reference its parts by variables. How do I do this?
Some of these need to be game objects while others do not.
The picture shows the PS1-Tank-Main with its smaller children.
1) I need to set game objects on the parent, the body, the spawn point and other children. (GO-P1-Tank)
2) I need to set variables for its controls (P1-Tank-Speed-Left).
I am assuming the non-game object variables I can just set any time. So for the tank speed, firing rate, reverse and so forth. However, how about the GAME OBJECTS? How do I set variables pointing at the parent and children of stuff I instantiate?
These need to be global variables to be accessed from other FSMs.
Thanks