Class rvalue used as lvalue?

Change the line to:

ACoinSound* SpawnedActor1 = GetWorld( )->SpawnActor<ACoinSound>( GetActorLocation( ) );

The issue is actually the &AActor::GetActorLocation. But I also wanted to let you know that SpawnActor is templated so you dont have to cast the way you are. Also you don’t need to define the class, but if you wanted to, it would be ASound::StaticClass( ) (To obtain the UClass* variable)