my Code doesn’t work. And I have no idea what to do to make it work. I would be so thankful if someone could help me.
So the actual code should ask from the Character.cpp the initialposition of the BrickPositionActor that is placed in the level.
But i get the error: no appropriate default constructor available
BrickPositonActor.h
#pragma once
#include "GameFramework/Actor.h"
#include "BrickPositionActor.generated.h"
UCLASS()
class ABrickPositionActor : public AActor
{
GENERATED_UCLASS_BODY()
//UPROPERTY(EditDefaultsOnly, Category = Position) //throws error: In BrickPositionActor: Unrecognized type 'void'!?!!?
const void GetPosition(FVector* blah);
};
You can’t just create on object of an actor. You have to do it by spawning it in the world so the engine will know that it was created, store it in the right place in memory etc. And when engine constructs your objects it gives it FPostConstructInitializeProperties.