How to use GetSprite()
I have a class that inherits from APaperCharacter, and I want to get the sprite instance from APaperCharacter and set its relative rotation with the code below.
Unfortunately I get the error "pointer to incomplete class type is not allowed" as seen in the picture below.
Does anyone know how to achieve my desired result and what is GetSprite() used for if you can't call functions on it?
asked Feb 12 '16 at 01:23 AM in C++ Programming
The PaperCharacter.h and PaperFlipbookComponent.h files are saved in the same folder so when adding the include for PaperFlipbookComponent.h, there is no need for "Engine/" at the beginning.
Additionally, just as a coding practice it would be better, rather than accessing the RelativeRotation variable and setting it directly, to use the SetRelativeRotation() function which takes in an FRotator argument of what you want the new rotation to be.
answered Feb 12 '16 at 05:06 PM
It seems like the UPaperFlipbookComponent* is only forward-declared at that point.
Have you included "PaperFlipbookComponent.h" in your source file? I don't know what the proper include path is right now, probably something like:
answered Feb 12 '16 at 09:59 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here