Good Afternoon Everybody,
This month I started to study a little bit more in Unreal 4, so I decided to challenge myself, how could I create an easy module.
What do I have it now?
1 - I have a module is loaded
2 - I can see that I can call a function and works fine
The only issue that I am living is, all the time when I am trying to get something from unreal like **GetOwner() **don’t work as I am not an unreal object.
So My module contains:
https://github.com/strubloid/unreal-…_Escape/Source
I tried to describe how I build this structure here:
https://github.com/strubloid/resume/…0a%20module.md
Now I need some help regarding modules for unreal, anyone has any idea how to build a simple module with just one Actor in this module, so I could start to build my own actor things for my idea?
[HR][/HR]I tried to create the object by myself:
Build File
using UnrealBuildTool;
public class Strubloid : ModuleRules
{
public Strubloid(ReadOnlyTargetRules Target) : base(Target)
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string] { });
}
}
**File: **[project-root]/Strubloid/Strubloid.Build.cs
Cpp File
#include "Strubloid.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_GAME_MODULE(FDefaultGameModuleImpl, Strubloid);
**File: **[project-root]/Strubloid/Strubloid.cpp
H File
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Strubloid.generated.h"
UCLASS()
class STRUBLOID_API AStrubloid : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
AStrubloid();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
};
**File: **[project-root]/Strubloid/Strubloid.h
*** This is my project file: **https://github.com/strubloid/unreal-…scape.uproject [HR][/HR]
I think that I am doing something wrong with this, and I can’t see where is this issue.
- The error that I am getting is that I can’t load the Strubloid.generated.h(Can’t find), so I can’t compile and I can’t use my object.
- I can literally navigate to the file using control + left mouse click
- I can see that the file is generated on: D:\unreal-games\Building_Escape\Intermediate\Build\Win64\UE4Editor**\Inc\Strubloid\Strubloid.generated.h
- **I tried to add **this file or the folder that contains the file…]\inc\Strubloid **on .vscode/c_cpp_properties.json (and I am still with the same issue)
Before coming here to ask I read a lot of things but I can’t figure it out how to fix this.
If anyone can help me out with this I will be very happy, as I am on this for 2 days now.
Thank you!
Raf.