Hello everyone!
I’ve got a problem: I’m writing a code for spawning units. So I have four files in total: “Barracks.h”, “Barracks.cpp” — is an actor class, and “BarracksUnit.h”, “BarracksUnit.cpp” — is a character class. There is UParticleSystemComponent called “SpawnPoint”, that participates in each implementation file.
So the problem is that “SpawnPoint” is seen only in “Barracks.cpp” because I declare it in “Barracks.h” file. Despite having included “Barracks.h” in “BarracksUnit.cpp” in “BarracksUnit.cpp” it doesn’t recognize “Spawn Point” and keep warning that identifier is not identified.
What I have tried:
- Switch files with declaration. So that I declared “Spawn Point” in “BarracksUnit.h” and included this header file to “Barracks.cpp”. It started recognizing “Spawn Point” in “BarracksUnit.cpp” but the same problem appeared in “Barracks.cpp”. So switching keeps the same issue
- Declare “Spawn point” in both “Barracks.h” and “BarracksUnit.h” files. It makes Unreal crush. So this didn’t work for me either.
So what can be done?