Why is this cast failing?

I can’t for the life of me under stand why this cast is failing. I have a side scrolling shooter and ammo/health drops after so many points. on overlap it cast to player adds to whatever the drop is and destroys it self. They are all built the same, but yet the all work except my machine gun ammo drop. You can pick up the health shotgun ammo rocket ammo, not machine gun ammo the first pic is the shotgun ammo which works, and second is machine gun ammo which is exact same and does not work.

Have you set a breakpoint at the cast and verified what is actually being sent as “Other Actor”? It might be a very good starting point.

dude. :smiley: thats by far not the same build up! correct ur cast to your sidescroller character like u did in shotgunammo :slight_smile: then check and tell me again if its working!

That’s just pure and impure it was impure before like the shotgun ammo and I did a print string on the failed which it did. A pure/impure cast doesn’t mean they are built different.

I tried going to the master class of the drops making a reference to the player at begin play, and it still doesn’t add. I even added the break point at the set and the references was the correct character, and even removed the error for the reference but still did not add to it.

and the question is why the cast is failing being pure/impure would not make a cast fail

Have you checked what is actually overlapping by doing the below?

129723-gds.png

I have, after deleting the whole chunk of code and recreating it. The cast is no longer failing, but now I really don’t understand, because I can now pickup the machine gun ammo, but not switch to it. Here is the switch

but it keeps setting it to the pistol of the weapons enum the ammo is greater than 0 and that print string fires, but it keeps setting it to pistol.

So I am going to make a new bug question because I literally can not switch the enum to machine gun I put the set just after the button press and I can switch to any gun of the enum except the machine gun. Not only that I set the default of the enum as machine gun, and it still reverts to the pistol.