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"

GetWorld() pointer to incomplete class type is not allowed

Hey! Plz Help. i do Replay System. https://wiki.unrealengine.com/Replay_System_Tutorial This part displays an error

 int32 APC_ReplaySpectator::GetCurrentReplayTotalTimeInSeconds() const
 {
     
     if (GetWorld())
     {
         if (GetWorld()->DemoNetDriver)
         {
             return GetWorld()->DemoNetDriver->DemoTotalTime;
         }
     }
 
     return 0.f;
 }

ERROR: pointer to incomplete class type is not allowed if (GetWorld()->DemoNetDriver)

Following instructions connect the following libraries: #include "TP_StrategyWithSteam.h" #include "Engine/DemoNetDriver.h" #include "PC_ReplaySpectator.h"

And TP_StrategyWithSteam.h not found...

Product Version: UE 4.15
Tags:
more ▼

asked May 30 '17 at 10:35 AM in C++ Programming

avatar image

TeddyJeez
38 1 3 6

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

2 answers: sort voted first

Add

 #include "Engine/World.h"
more ▼

answered May 30 '17 at 08:58 PM

avatar image

ExtraLifeMatt
1.6k 34 14 48

avatar image TeddyJeez Jun 07 '17 at 04:59 PM

THANK YOU, SO MUCH! :D

avatar image shrikky Oct 07 '17 at 10:08 PM

Thanks mate. ! I am going to be more active in forums so people are encouraged to post answers, so will I when I find something. To add on to his answer, look into IWYU of UE4, from now on you have to add all the header files of classes you intend to use, this is to reduce compile time.

avatar image tronguignard Dec 17 '17 at 04:33 AM

You are literally GOD.

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

Right now, in the documentation says that we need to use this #include "Runtime/Engine/Classes/GameFramework/Actor.h" if we are handling an AActor, if we are handling an UWorld we have to use #include "Runtime/Engine/Classes/Engine/World.h".

more ▼

answered Feb 22 '19 at 09:28 AM

avatar image

SalahAdDin
21 4 10 9

avatar image JohnHudeski May 22 '19 at 01:39 PM

Guys this doesn't work for me. it's an instant crash

avatar image ExtraLifeMatt May 22 '19 at 02:42 PM

You're likely missing an if-check and accessing a null pointer.

avatar image JohnHudeski May 23 '19 at 07:43 PM

I dont remember how i fixed it but thanks for replying

(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