I’m currently experiencing issues casting my player class to a volume I’ve created.
When debugging in VS17 the cast (Player) appears to come up NULL.
This is a function within a jump pad class.
void AJumpPadVolume::OnActorEnteredVolume(AActor * Actor, AActor * Actor2)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("JP: Function called!")));
AHomagePlayer* Player = Cast<AHomagePlayer>(Actor);
// If the actor that touched the pad is a player then launch the player
if (Player && Enabled)
Player->SetVelocity(JumpVelocity);
}
I have added the Player header file to includes and nothing seems to happen.
When I check the Actor it comes up as the following:
LogTemp: Warning: Actor is /Game/Scenes/UEDPIE_0_dev_Test01.dev_Test01:PersistentLevel.JumpPadVolume_1 :
So that appears to be working okay, from what I can tell.
Been looking at this for a few hours now while researching without any resolve. Would appreciate any assistance.