-2

I'm following a guide on how to make a finite state machine plugin in Unreal Engine. I have ran into an issue when I #include a .h file from my plugin into my Unreal C++ class. The issue is that when I #include "StateManagerComponent.h" (Plugin Class) into "GoblinFSM.h" (Unreal Class) with its total relevant file path, my code stops being able to find "StateManagerComponent.generated.h"

Added Full File Path to include StateManagerComponent.h

Resulting in StateManagerComponent.generated.h no longer being found

I have added both paths to the include in my project's VC++ Directories hoping that my project would then be able to find the StateManagerComponent.generated.h file and the StateManagerComponent.h file at the same time. Unfortunately, it just gave me ~10,000 errors. Really don't know where to go from here.

kiner_shah
  • 3,939
  • 7
  • 23
  • 37
Jbasham
  • 1
  • 1

1 Answers1

1

I noticed that you're importing the whole absolute path of your machine to include the StateManagerComponent.h. You don't have to do that as Unreal Engine Build Tools set up the visual studio solution so that every reference can be made relative.

If you need to include the StateMachinePlugin\Public path on your header file will depend on how you set up your Build.cs file. You can look at how Epic set it up in all modules across the engine. Here's more info about it: https://docs.unrealengine.com/4.27/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Modules/

If you already made changes to your Visual Studio project or solution files I suggest that you delete your .vs, your sln and your intermediate files and regenerate the Visual Studio files from within Unreal Engine or using the context menu in Windows Explorer.

The generated files will always live in your Intermediate/Build folder and will have all the info needed from the UCLASS, UFUNCTION, etc macros.

Robo
  • 66
  • 5