Why am I unable to switch weapons in ShooterGame?

I believe this is a bug, but when using the shooter game code in my current game I cannot switch any weapons. I went into Engine Input and looked at the key bindings, and even reset them and everything looks normal. The playerpawn has the weapons in the inventory. Another weird bug is I cannot pick up any ammo from the ammo pickup. I can pick up health just fine though. Anyone know or can point me into the right direction what is going on?

it’s not a bug its in the code, they set it for single weapon only, found it the other day but can’t remember of hand which file it was , maybe shootercharacter.
i’m not sure about the ammo, make sure you don’t have infinite ammo or clips on

GeoDave is it the shootercharacter in the source folder?

yep the shootercharacter.cpp search for “gdc” line 517

not sure why but maybe due to the asset not being ready !!!

Anybody got it working,can someone say what i need to change

i’ve just looked at the code file and it’s still there, i’ll be honest i don’t know enough code (or any) to try and change it back.

maybe if you add // in front of int32 NumWeaponClasses = 1; then re-compile the code it might work

ok tried that didn’t work, you’d have to change that NumWeaaponClasses bit, maybe set that value to 2 and re-compile !!!
sorry i can’t code to save my life

i can not code either i chanded allot of things still no luck, hope they will change it at the next update

they backslash this out //DefaultInventoryClasses.Num(); maybe it must be replace int32 NumWeaponClasses = 1;

get in touch on the forum (pm) :wink:

I Finaly Found out Here is the code

void AShooterCharacter::SpawnDefaultInventory()
{
	if (Role < ROLE_Authority)
	{
		return;
	}

	// @hack to remove rocket launcher
	int32 NumWeaponClasses = 2; DefaultInventoryClasses.Num();
	for (int32 i = 0; i < NumWeaponClasses; i++)
	{
		if (DefaultInventoryClasses[i])
		{
			FActorSpawnParameters SpawnInfo;
			SpawnInfo.bNoCollisionFail = true;
			AShooterWeapon* NewWeapon = GetWorld()->SpawnActor<AShooterWeapon>(DefaultInventoryClasses[i], SpawnInfo);
			AddWeapon(NewWeapon);
		}
	}

	// equip first weapon in inventory
	if (Inventory.Num() > 0)
	{
		EquipWeapon(Inventory[0]);
	}

}

if this hasn’t been resolved here’s the code changes that need to happen and yes this is in ShooterCharacter.cpp

void AShooterCharacter::SpawnDefaultInventory()
{
	if (Role < ROLE_Authority)
	{
		return;
	}

	  //THIS IS WHAT NEEDS TO BE CHANGED 
      //@hack to remove rocket launcher
      // FROM the INT32 to DefaultInventoryClasses.Num();

	//int32 NumWeaponClasses = 1;
	DefaultInventoryClasses.Num();
      // YOU HAVE TO CHANGE THIS PART SO IT SEARCHES THRU THE ARRAY
	for (int32 i = 0; i < DefaultInventoryClasses.Num(); i++)
	{
		if (DefaultInventoryClasses[i])
		{
			FActorSpawnParameters SpawnInfo;
			SpawnInfo.bNoCollisionFail = true;
			AShooterWeapon* NewWeapon = GetWorld()->SpawnActor<AShooterWeapon>(DefaultInventoryClasses[i], SpawnInfo);
			AddWeapon(NewWeapon);
		}
	}

	// equip first weapon in inventory
	if (Inventory.Num() > 0)
	{
		EquipWeapon(Inventory[0]);
	}
}

This will put it back to before the GDC changes if you have any questions feel free to contact me or ask here