x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to use GetSprite()

Hello Everyone,

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.

 GetSprite()->RelativeRotation = FRotator(-60.f, 0.f, 0.f);

Unfortunately I get the error "pointer to incomplete class type is not allowed" as seen in the picture below. alt text

Does anyone know how to achieve my desired result and what is GetSprite() used for if you can't call functions on it?

Product Version: UE 4.10
Tags:
error.png (4.3 kB)
more ▼

asked Feb 12 '16 at 01:23 AM in C++ Programming

avatar image

BitBoy92
488 53 38 57

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hey Farshooter-

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.

Cheers

Doug Wilson

more ▼

answered Feb 12 '16 at 05:06 PM

avatar image BitBoy92 Feb 13 '16 at 12:19 AM

That did the trick! Thank you @Doug Wilson for you help and good advice.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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:

 #include "Engine/PaperFlipbookComponent.h"

more ▼

answered Feb 12 '16 at 09:59 AM

avatar image

fszczemton
291 16 19 248

avatar image BitBoy92 Feb 12 '16 at 03:03 PM

Thank you for your answer. It looks like "Engine\PaperFlipbookComponent.h" is not the correct path.

How would you find the correct path? I looked through the documentation here and couldn't figure it out.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question