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 not working with intellisense

When I use GetWorld()-> in my code it compiles and runs fine. However, it won't give me the intellisense drop down menu to show possible options that would follow GetWorld and there is a red squiggly line under GetWorld. I am fairly new to coding, so if you do happen to know the solution please provide it in a simplified matter or if you could thoroughly explain why this is happening and its solution.

Any help is greatly appreciated, thank you!

Product Version: UE 4.19
Tags:
more ▼

asked Aug 10 '18 at 08:03 PM in C++ Programming

avatar image

jjwarren44
3 1

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

1 answer: sort voted first

Some classes such as AActor have access to GetWorld() by default, while others do not. If Intellisense complains about it, you will need to include a header file at the top of your .cpp file to get access to it.

I think the code still works without this, but I believe the need for the header file for Intellisense came along in a relatively recent patch where many headers were no longer included by default so that it would only have to read the files that are actually being used.

Anyway, this is the line you need at the top of your .cpp file:

#include "Engine/World.h"

more ▼

answered Aug 10 '18 at 08:56 PM

avatar image

Raptorcore
51 1 6 6

avatar image jjwarren44 Aug 10 '18 at 09:34 PM

Thank you, that fixed it!

(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