Hi, I have two classes I need to be able to communicate with eachother. A character, and an animinstance.
I wish to trigger an animation in the animinstance from the character (this part I have done without issues by doing an #include and getting the animinstance in my character), then when the animation is done in the animinstance, I wish to in turn trigger a function in my character. Now I cannot just do #include and get the character again, as that would result in a circular dependency loop.
The best way around this appears to be a forward declaration within my animinstance, but I cannot quite seem to find good examples of the right syntax for this and haven’t done this before.
This is what I got so far
animinstanceheader.h:
class ATribesmenCharacter;
ATribesmenCharacter* Char;
cpp:
UCharAnimInstance::UCharAnimInstance(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
Char = Cast<ATribesmenCharacter>(TryGetPawnOwner());
}
But I get the following error:
use of undefined type 'UCharAnimInstance::ATribesmenCharacter'