Overhauling the Shoot Mechanics Pt. 2


Author: Tyler Clardy
Date Posted: 6/13/2024

I have finalized the overhaul of the Shoot mechanic. I added color-changing logic to the crosshair that tracks when the player is aiming at an enemy, as well as Call of Duty-style hit markers for when a player shot successfully hits an enemy. 

I'll start with the color-changing mechanic. I use a similar line tracing approach to what was used to create the new Shoot system, as described in my previous dev log, and I do this every tick for the Player. It checks where the player is currently aiming, and then sets the crosshair color appropriately. 

Player Logic:


Color Change Logic:


This can be seen functioning with the debug info turned on here:

Next, I added the hit marker effect to the crosshair widget itself, which was made fairly simple by using a custom animation. I used the animation to set keyframes controlling the rendering opacity of the hit marker crosshair - which is always present and overlayed on top of the normal crosshair. It is just normally rendered invisible. The animation makes the hit marker crosshair appear immediately, then fade back to invisible over the course of about 1 second.

Logic & Animation:


Based on feedback from a peer, I also changed out the SFX for the rifle shot to be a heavier and more weighty sound.

Finally, you can see this all functioning together in the video below:


My remaining work for this sprint will be around miscellaneous bugs, and looking into the animation stuff I mentioned last time. Next week I plan to dig into the Trap mechanics and see about overhauling our 'Place Trap' ability. Mostly with the goal to create a visual indicator of whether a location is valid for placement, on the fly during the use of the ability.

Get Dimension Defender

Leave a comment

Log in with itch.io to leave a comment.