Dear Unreal Community,
I am currently working on a 3rd person rpg game as part of my final year project at university and I have hit a snag when it comes to spell casting.
my character class has a variable type UBlueprint (based on class ASpell) which represents the currently equipped spell when I press mouse button I call CastSkill function in my character class which cast the currently equiped spell blueprint as ASpell and calls the ASpells class function CastSkill and passes in character location and rotation :
void ASkill::CastSkill(FVector Location, FRotator Rotation)
GetWorld()->SpawnActor<UBlueprint>(VisualEffect->GetClass(), Location, Rotation, FActorSpawnParameters());
VisualEffects is a variable type UBlueprint that represents the spell projectile.
during the spawning i get an error “Access violation reading location” and crash
Any ideas on how to solve this or what I’m doing wrong would be greatly appreciated. If needed I can post or explain more of my code.
Thanks in advance.