top of page
Search
Writer's pictureConor Currie

Problems With Ammo

Updated: Jan 21, 2022


Pretty good summary of the fun I've had with Unreal this week.


Despite a few issues, I've managed to get Ammo and guns working in Unreal Engine. My issues came primarily from a few minor errors I made in defining variables. For example, many variables were required to be integers, but I mistakenly had them down as Boolean, understandably not allowing the code to compile correctly. This was an easy fix, as seen below.





My main issue came with the Assault Rifle. In developing the gun, my program crashed. I booted it up, to find that while everything was pretty close to where I'd left it, the assault rifle wasn't working. This was in part to a misnamed variable in the Blueprint of the AssaultRifle.

In my rifle code, I called for the function of "Fire Bullet". However, my function was labelled FireBullet, which meant that the code did not recognise this function. I renamed this, but this did not fully fix the rifle, which was failing to work correctly. However, I recognised that the SetTimerByFunctionName did not have a return value. I then realized that part of the code that was lost by the crash was a PauseTimerByHandle, which I then linked into the Event Stop Fire and made it the return value from the PauseTimerByHandle.


Rifle thankfully worked as intended after this, as seen below.



0 views0 comments

Recent Posts

See All

Comments


Post: Blog2_Post
bottom of page