I using the code from the Shooter Demo as reference to make a thing in Blueprints, but i got a problem here:
void AShooterCharacter::SpawnDefaultInventory()
{
if (Role < ROLE_Authority)
{
return;
}
int32 NumWeaponClasses = DefaultInventoryClasses.Num();
for (int32 i = 0; i < NumWeaponClasses; i++)
{
if (DefaultInventoryClasses*)
{
FActorSpawnParameters SpawnInfo;
SpawnInfo.bNoCollisionFail = true;
AShooterWeapon* NewWeapon = GetWorld()->SpawnActor<AShooterWeapon>(DefaultInventoryClasses*, SpawnInfo);
AddWeapon(NewWeapon);
}
}
...
void AShooterCharacter::AddWeapon(AShooterWeapon* Weapon)
{
if (Weapon && Role == ROLE_Authority)
{
Weapon->OnEnterInventory(this);
Inventory.AddUnique(Weapon);
}
}
/** default inventory list */
UPROPERTY(EditDefaultsOnly, Category=Inventory)
TArray<TSubclassOf<class AShooterWeapon> > DefaultInventoryClasses;
/** weapons in inventory */
UPROPERTY(Transient, Replicated)
TArray<class AShooterWeapon*> Inventory;
/** currently equipped weapon */
UPROPERTY(Transient, ReplicatedUsing=OnRep_CurrentWeapon)
class AShooterWeapon* CurrentWeapon;
This is what i got now:
https://dl.dropboxusercontent.com/u/28070491/UE/Forums/BPCodeQuestion.png
*Clear BP
https://dl.dropboxusercontent.com/u/28070491/UE/Forums/ClearProblem.png
Then i got problems with that lines:
FActorSpawnParameters SpawnInfo;
SpawnInfo.bNoCollisionFail = true;
AShooterWeapon* NewWeapon = GetWorld()->SpawnActor<AShooterWeapon>(DefaultInventoryClasses*, SpawnInfo);
My problem is how manage the spawn or how make that like in the C++ code.
How or for what i give the index of DefaultInventoryClasses* ?? and how made that in BP ?
Can some one give me an example of this or what is bad ? if is possible with a screen of the configuration in BP.