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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Compiler errors C2027 and C222 in GameCharacter.cpp

I have no experience in C++ and only built my project in it so C++ plugins wouldn't break my BP project.

I have not edited the GameCharacter.cpp file and am using a blueprint Character Actor not derived from this .cpp, could I just delete this .cpp file to get rid of the error?

The error messages are:

C2027 | Use of undefined type 'UWorld'

C2227 | left of '->GetDeltaSeconds' must point to class/struct/union/generic type

And reference this block in my GameCharacter.cpp

 void AGameCharacter::TurnAtRate(float Rate)
 {
     // calculate delta for this frame from the rate information
     AddControllerYawInput(Rate * BaseTurnRate * GetWorld()->GetDeltaSeconds());
 }
 
 void AGameCharacter::LookUpAtRate(float Rate)
 {
     // calculate delta for this frame from the rate information
     AddControllerPitchInput(Rate * BaseLookUpRate * GetWorld()->GetDeltaSeconds());
 }

As Well as the definition in "ActorComponent.h"

 virtual UWorld* GetWorld() const override final { return (WorldPrivate ? WorldPrivate : GetWorld_Uncached()); }

Product Version: UE 4.20
Tags:
more ▼

asked Aug 12 '18 at 07:47 AM in C++ Programming

avatar image

_Lime_
1 2

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

1 answer: sort voted first

This is likely a duplicate to:

https://answers.unrealengine.com/questions/605880/getworld-pointer-to-incomplete-class-type-is-not-a.html

In short, at the header, include

 #include "Engine/World.h"
more ▼

answered Aug 13 '18 at 12:27 PM

avatar image

Aericks
120 6 8 17

(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