Without knowing much about how the rest of your project is setup, I would one of the following approaches:
- Pass in the Squad to the character that is being created as it’s being created
- Assign the Squad to the character through a higher level process
- Tweak your architecture such that the character does not requires knowing the Squad it is a part of
If there’s going to be a dependency between those two types, it’s better to make that explicit upfront. It also likely that there’s no reason to try and discover the information when the code spawning the character actor probably already knows the Squad they should be added to (since it’s probably the Squad spawning them in the first place?).