Posted June 05, 2022 by PcKaffe
#update
I made some updates based on the feedback from the gamejam comments. Nothing major except a fix that might appear as a feature.
That last point, isn't that a feature? Well, yeah maybe. But I feel that it was the best way to fix the "bug" with shots missing their targets. The reason players felt that shots were missing was because the aiming raycast only hit the ground, meaning they could be slightly off from what they thought they were aiming at. So why not just make the raycast hit everything? Well, it did in the beginning but I found that it caused the turret to aim in a jittery way because if your raycast hits the top of a lamppost in one frame and the ground in the next frame the turret would jerk quite a distance. The crosshair then just follows the cursor with a slight offset to make it more in line with what players expect. I could have changed the crosshair image to a mouse cursor but at that point, f**k it, the game now has a crosshair to fix the bug of projectiles missing their targets.