Hello
Im working on a semi-procedural BP Based level generator in a nutshell all my level “templates” are a blueprint made of various static mesh components, i have a ProceduralManager UObject class that is initialized once the game begins , then based on various inputs it spawns the Blueprint Templates / Rooms
My issue is that before i spawn the room Blueprint i need to access one of its properties to make a check, I have all the “Rooms” linked to a main blueprint as On a array as this
TArray > LinkedRooms;
But when i try to access any of its member the compiler shows me that the member isnt part of it… To be exact,
error C2039: ‘bIsSpawnRoom’ : is not a member of ‘UObject’
#pragma once
#include "Object.h"
#include "PCManager.generated.h"
USTRUCT()
struct FRoomTheme
{
UPROPERTY(EditAnywhere,Category = ThemeInfo)
TArray<TSubclassOf<class APCRoom> > LinkedRooms; // All the rooms / templates linked to this theme
};
/**
*
*/
UCLASS(Blueprintable)
class UPCManager : public UObject
{
GENERATED_UCLASS_BODY()
virtual void InitGeneration();
UPROPERTY(EditAnywhere, Category = ProceduralGeneration)
bool bPickRandomSpawnTheme;
UPROPERTY(EditAnywhere, Category = ProceduralGeneration)
FRoomTheme CurrentTheme; // Theme the generation will start with if bPickRandomThemeAtStart is false
};
.CPP
#include "PCGame.h"
#include "PCManager.h"
UPCManager::UPCManager(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
void UPCManager::InitGeneration()
{
FVector SpawnLoc;
FRotator TheRot;
if (bPickRandomSpawnTheme)
{
}
// initiate the current theme from editor if we are not supposed to pick a random one
for (int32 i = 0; i < CurrentTheme.LinkedRooms.Num(); i++)
{
if (CurrentTheme.LinkedRooms.IsValidIndex(i)) // index is valid ? no crash and continue
{
if (CurrentTheme.LinkedRooms[i]->bIsSpawnRoom) // HERE! Is the Issue!!
{
()->SpawnActor(CurrentTheme.LinkedRooms[i]);
}
}
}
}
Thanks