Hello,
I have C++ FPS project. With simple ASpawnClassActor, which extending ANavigationObjectBase, In short its just like engine PlayerStart but with more properties (isTeamleader, isSquadLeader, teamName, locked, health, class).
I have placed these actors on map, then in Level blueprint I iterate thru all actors for specific team and let player pick one spawn point.
Now comes problem.
I want to store in variable a object reference of selected spawnpoint.I think best place is to store it in BasePlayerController
I have created a variable in BasePlayerController.h
// Holds where to Spawn player
// TSubclassOf<AActor> SpawnClassActor;
// ANavigationObjectBase* SpawnClassActor;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = PlayerController)
ASpawnClassActor* SpawnClassActor;
UFUNCTION(BlueprintCallable, Category = PlayerController)
void SetSpawn(ASpawnClassActor* Spawn);
Then I have preSpawn screen Blueprint widget which contains list of spawn actors (ClassItem)
When user click on Select specific spawn class, I want to send Object reference to C++ (ASpawnClassActor* SpawnClassActor) and after there is custom PlayerSpawnSearch implementation (which i hope works).
Now I am saving the reference of SpawnClass incorrectly, but I dont know how to fix it.
Any help is welcome, probably I dont understand correctly communications between Blueprint and C++. ¨
Thanks for reply