So I’m 100% new to the Unreal Engine, and I’d like to create a C++ class using the “None” option, as shown in this picture…
I chose “None”, because the class I am implementing will not be spawned in game (at least not visually). It should be a Global object, I don’t need to be able to reference the variable holding the object globally, I only need its lifetime to exist until the game ends (I also need to find out how to do this).
The purpose of this custom class is to work as a networking interface for a 3rd party server that I’ve developed, did I choose the correct C++ class type for this? I think I did, but a more seasoned Unreal Developer may know better. In other words I need to be able to call at it to send data to the server, and then I need it to be able to call another interface (not yet made) that handles responding to server messages and applying their functionality/instructions. In my own first example I’ve created a UMG Login Screen, and when the user clicks “Login” I want it to create an instance of this new Class that lives until the client disconnects from the game. However, when I go to the Login Button onClicked event in BluePrints the class is no where to be found.
When I try to make the Class & expose it to Blue prints, I get errors… These ones to be exact.
From this I’m understanding that I need to inherit from UObject, but why…? Even if I do inherit from UObject, I still get these errors…
This is my code…
TestClass.h
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
/**
*
*/
UCLASS(BlueprintType, Blueprintable)
class GAMECLIENT_API TestClass : public UObject
{
public:
TestClass();
~TestClass();
};
TestClass.cpp
// Fill out your copyright notice in the Description page of Project Settings.
#include "GameClient.h"
#include "TestClass.h"
TestClass::TestClass()
{
}
TestClass::~TestClass()
{
}