There are 3 different objects to be picked up from the ground.
The code doesn’t work with is valid exec. But in order to the object on the ground after picking it up i believe its necessary. If i remove is valid the objects get picked up by the character but they also still be on the ground also.
You cannot rely on setups like this, not here and not in the long run. Thoroughly unsafe is the most gentle way I’d describe it:
It should not work. And even if does work today (it already does not), it will definitely not work tomorrow when you add more stuff. Do not attempt to access data from an execution chain that has yet to fire. Do not do it even though you know, for a fact, it has been already executed anyway. The only exception is the SET node since it also works as a pure getter. But even then you’re risking an ordering issue - especially with the Enhanced Input which is not guaranteed to fire every frame - have a look at its tooltip.
If you want to access the return of the cast, cache it in a variable. This will allow you to use Validated Get
. At the very least consider:
If you ever feel forced to create a cascading waterfall of cast branches, perhaps it’s time to look into interface communication.