Cast problem

I’m still stuck on this :confused:

Here is the class where i use the Cast :



#include "Arena.h"


AMagic::AMagic(const class FPostConstructInitializeProperties& PCIP)
	: Super(PCIP)
{


}


void AMagic::Cast()
{

}



bool AMagic::ServerCast_Validate(FVector Origin, FVector_NetQuantizeNormal ShootDir)
{
	return true;
}

void AMagic::ServerCast_Implementation(FVector Origin, FVector_NetQuantizeNormal ShootDir)
{
	FTransform SpawnTM(ShootDir.Rotation(), Origin);
	AProjectile* Projectile = Cast<AProjectile>(UGameplayStatics::BeginSpawningActorFromClass(this, MagicConfig.ProjectileClass, SpawnTM));
	/*if (Projectile)
	{
		Projectile->Instigator = Instigator;
		Projectile->SetOwner(this);
		Projectile->InitVelocity(ShootDir);

		UGameplayStatics::FinishSpawningActor(Projectile, SpawnTM);
	}*/
}