Fixed Waypoint Appearing for Inactive Checkpoints
This commit is contained in:
parent
97ac729dd5
commit
bae8955a27
@ -48,6 +48,7 @@ void ABountyClass::SpawnCheckpoints()
|
||||
|
||||
// Activate the first checkpoint and listen for its completion
|
||||
BountyCheckpoints[0]->Active = true;
|
||||
BountyCheckpoints[0]->SpawnWaypoint();
|
||||
BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
|
||||
}
|
||||
|
||||
@ -84,6 +85,7 @@ void ABountyClass::IncrementBountyCheckpoint()
|
||||
|
||||
// Set the new checkpoint in pos 0 to be active and listen for it's completion
|
||||
BountyCheckpoints[0]->Active = true;
|
||||
BountyCheckpoints[0]->SpawnWaypoint();
|
||||
BountyCheckpoints[0]->CompletedCheckpoint.AddDynamic(this, &ABountyClass::IncrementBountyCheckpoint);
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,10 @@ ACheckpointClass::ACheckpointClass()
|
||||
void ACheckpointClass::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
}
|
||||
|
||||
void ACheckpointClass::SpawnWaypoint()
|
||||
{
|
||||
if (!IsValid(WaypointActorClass)) return;
|
||||
|
||||
FActorSpawnParameters SpawnParams;
|
||||
|
@ -48,6 +48,8 @@ public:
|
||||
UPROPERTY(BlueprintReadOnly, Category = "Checkpoint")
|
||||
bool Active = false;
|
||||
|
||||
void SpawnWaypoint();
|
||||
|
||||
// ------ Getters for CP Properties ------
|
||||
FString GetCheckpointDesc()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user