Try the pencil test. Set the striker. Point the (unloaded, of course) gun in the air, drop a pencil, eraser first, down the barrel and pull the trigger while holding the gun pointed at the ceiling. If the pencil jumps, you're problem wasn't caused by the firing pin.
How about a bit more information? First time out with the gun? New or new to you? If new to you (used), any idea of how many rounds have been through it? Factory ammo or reloads?
I had a problem with one of my XD9s once when using some reloads. The loads were manufactured by a commercial reloading company (*not Georgia Arms*) that I had used before and trusted. For what it's worth, the guy had several range ammo contracts in his area. Anyway, a couple of rounds into a new mag, the gun didn't fire. I looked close at it and it appeared to be in battery. Ejected the shell and there was no striker mark. Happened again a few rounds later. This time, it was clearly out of battery and I hit the back of the slide with my palm. Seized but the gun so bad I had to use a dowel down the pipe to get the round out. Went through with a case gauge and many of the rounds were no-go. Most were very slight, almost fits. I shot every single one of them through one of my tanks (S&W 5946) without a hitch at the next range. This was a very odd problem and stumped me completely until I got the case gauge. The ammo worked perfecting in my Glocks and S&Ws and even a Browning Hi-Power.
Another thing I can think of is, if the gun has been shot at least a fair amount, there may be junk (sludge) in the firing pin channel. So maybe a detail strip and complete cleaning might be in order.