Custom BP with C++

Hey everyone,

I’m struggling to make a custom Uobject that i can use in BP that only has these flags:

bool IsNameStableForNetworking() const override;

bool IsSupportedForNetworking() const override
{
return true;
}

I’m trying to create a Uobject that I can replicate over the network, but everytime I try to do this on my own I get lots of errors in Visual Studio. I don’t have any previous C experience, which makes this difficult. :frowning:

Can anyone post what the header and cpp would look like?

HAH! I figured it out with lots of help from the folks on the unreal slackers discord :slight_smile:

#pragma once

#include "CoreMinimal.h"
#include "UObject/NoExportTypes.h"
#include "NetworkUObject.generated.h"

/**
 * 
 */
UCLASS(Blueprintable, BlueprintType)
class PROJECTNAME_API UNetworkUObject : public UObject
{
	GENERATED_BODY()
		bool IsNameStableForNetworking() const override
	{
		return true;
	}
	bool IsSupportedForNetworking() const override
	{
		return true;
	}
};