There is a lot of good advice here.
If you are only making games for practice and in private, then you should expect to be okay. Companies know that it is expensive to fight, but some are very willing to do it, even if only to send a message and prevent open stealing of their intellectual property.
I know of several companies that got sued or had cease and desist orders put on them. On face value a cease and desist order may not seem like a big deal but the company gives a "shot across the bow" with this. You have to stop and restart your game development which can destroy some game development entities in this case. The legal fees for counsel are hundreds of dollars per hour, so fighting is not an option.
I say better safe than sorry.
Creating fictional weapons is just as fun as historical ones but with little risk if you secure your rights by publishing the rights with your product.
On the other hand, some companies seek the publicity and will gladly grant you written permission to use their product designs. Asking for permission is low risk and only costs you time. With negotiating skills, you may be able to offer value to the copyright holder by giving them credit and perhaps also free advertising somewhere.
Game development success apparently requires many skills in order to sustain an income with it.