Select Node Not Properly Working With Invalid Object

This might not be the intended use of the Select Node but I am using the select node to maximize organization when programming ammo pickup calculations in relation to the children classes of my Weapons Class. The Weapon slots in the player’s inventory will register as invalid if they don’t have that type of weapon currently in their inventory, hence the Is Valid check in my code. If the weapon slot is invalid, it will return an error message regardless of whether my code actually tries to access the blueprint or not. Is this outside the bounds of what the select node is intended for or is this a bug?

Note that the Pistol and Special pins are intentionally left empty and have no impact on the situation. I can easily rearrange the code to work properly.

Error Blueprint Runtime Error: Accessed None trying to read property Weapon3_Rifle from function: ‘AddAmmoToInventory’ from node: Set DoesAmmoExceedMax in graph: AddAmmoToInventory in object: charbp_player with description: Accessed None trying to read property Weapon3_Rifle

Hi there! I am also having this problem. Did you end up finding any sort of workaround?

Hi,

It is possible to create our own function “select”, with multiple return nodes, thereby we can send the right data ignoring invalid ones.

This solution work for me, hope it helps.

Have a good day.

Hello. You can get around this using a function.