The Issue Of Not Following Existing Knowledge


Author: Orion White

Date: 10/10/2025

For our game, I wanted to make a weapon / loot system that is similar to Borderlands and other looter shooters. As such, I didn't feel that the way we were taught to make guns was very effective, as I would need to create a bullet and weapon for each possibility before hand, which would be highly time consuming. I needed a way to create weapons on the fly, with randomized stats and models, so I looked up some videos on how and followed along with them (They do it entirely in blueprints, so I had to figure out how it would be converted into C++). 


Now, the problem? Our original systems - for character, player and everything else - was not designed to use a SkeletalMeshComponent for the weapon, as it was handled like an actor in our characters.  Naturally, I went through our BaseCharacter and derived classes to make them compatable with the new weapons system, but it still had a lot of issues. Some of those issues and fixes are as follows:

     The weapon would always spawn on the ground because there was a bool being passed as true instead of false to a component creation function. Took me forever to find it, as there was many function calls that could've been the issue at this point - 3 hours to fix

     The weapon would not be created because of incorrect parameters passed to a function - < 1 hour to fix

     I had to convert some assets into Skeletal Meshes from Static Meshes, which wasn't nearly as bad as I thought it would be. Just had to export the asset and reimport it with a skeleton - < 1 hour to fix

     I wasn't aware that physics settings should only be set in the begin play, as some settings would cause the physics component of the uasset to be compiled / created before the GEngine. This caused many lost hours when trying to cook the project for a build, as we would get an error along the lines of "Cannot call GetSimplePhysicsComponent as GEngine does not yet exist. Never call GEngine in the constructor, and if you must, wrap it!" Seems fine and very helpful at first until you realize this error only appears during the cooking of a project, and since it doesn't tell us the file, we had to tear through our code base to find where it was using Physics, as it is kind of hard to remember when you have a lot of different .cpp's in your project. - ~4 hours to fix

And this was just a few of the issues. I had bugs that would cause the weapon to be massively oversized, firing would sometimes break and each weapon would turn into a single use like the weapons you get from vending machines in Cyberpunk 2077. Projectiles would shove the player around if the weapon was fired while moving, along with a whole slew of other problems. Overall, I am still far from finished with this system and it was a very time consuming process that I foolishly tried to cram into a 2 day sprint. Let this be a warning, if you try to attempt something you are unfamiliar with, save it for when you have plenty of time, as you might run into problems that take hours to resolve.

Leave a comment

Log in with itch.io to leave a comment.