I would like to reiceive intellisense suggestions however, intellisense says there is an error and doesn’t show me any suggestion. The code does compile. I am following the BatteryCollector tutorial series that is given in UE4 video tutorials page. I heard that it’s normal to get these errors but the woman who made the tutorials get the suggestions and no errors.
[Edit start] Using latest version of UE4, 4.16.3. The error happens when using VS 2015 and when using VS 2017 (which are the only options). [Edit end]
Examples:
Tutorial 2 or 3 - Error: a value type of "UStaticMeshComponent " cannot be assigned to an entity of type “USceneComponent *” (note: UStaticMeshComponent is also a pointer, but if I place an asterisk part of the text gets in italic.)
RootComponent = PickupMesh;
_
Tutorial 6 - Error: pointer to incomplete class type is not allowed
FVector SpawnLocation = SpawnBox->Bounds.Origin
_
Tutorial 6 - Error: a value type of "UBoxComponent " cannot be assigned to an entity of type “USceneComponent *” (note: UBoxComponent is also a pointer, but if I place an asterisk part of the text gets in italic.)
Sometimes the Intellisense can be wrong when the build has no errors. Try opening the project and compiling. If the compile completed successfully then you all set!
I asked for help at the Discord server (Unreal Slackers) where LethalClips told me that on version 4.15 there was an update on which most libraries must be included.
I fixed the errors by including the components: #include “Components/StaticMeshComponent.h”
and #include “Components/BoxComponent.h”
Also, I tried something like this before (saw that suggestion while searching for solutions) but used the wrong library. In order to find the library, check the path to the class you’re using in the link to the documentation.
You may also get some compile errors as I did get after. But as long as you include the libraries it works perfectly, intellisense suggestions too! :3
Example:
for UBoxComponent, go to the Unreal Engine Documentation website and search for “UBoxComponent”, make sure it’s searching in the C++ API (after you search, buttons appear, where choose in which category you wish to search on, such as “All”, “Documentation”, “C++ API”, “Blueprint API”,etc.) now check the last tab, “References”, for the header to include.
For UBoxComponent it’s #include “Components/UBoxComponent”
Edit: Typo fix and making the text easier to understand.
Edit2: Updated to the correct method to the header to include.
“I heard that it’s normal to get these errors but the woman who made the tutorials get the suggestions and no errors.”, I did say this.
But thanks still. ^^