Infinite Loop on Fire

Hi everyone, I know this is probably a really obvious fix, but I’m a complete noob.

I’m trying to make a weapon that can be picked up and fired.

So far I can run the game, but when the i try to pick up the gun, I get an “infinite loop” error and the game crashes. It’s saying it’s in the “Fire” event, but I can’t see where.

Any advice would be greatly appreciated.
Screenshot 2024-04-20 124121
Screenshot 2024-04-20 124154



I’m just starting on my journey with Unreal. Any tips or pointers are welcome.

Hello,

Nothing looks wrong in the code you posted at first glance.
But you should check where the Fire event is called by right clicking on the event and “Find references”. If an error in Fire is triggered when you pickup the weapon and not while you’re firing it that means the function is called where it shouldn’t.
You can also put a breakpoint in your first Cast for example and check the stack when it’s triggered with the Blueprint debugger:

2 Likes