Devlog #3: throwing grenades and merciless hitscanning


My approach to game development is rarely ticking one thing off after another. In many ways its a complicated mosh pit of various systems being created at once. For instance:

  1. The shotgun model was added and animated
  2. The beauty that is weapon sway was implemented
  3. A system for slightly rotating the camera from side-to-side was added, as was the style at the time
  4. Audio was put into the game
  5. And work started on the grenadier

The grenadier was where it got interesting, as I attempted to create an enemy capable of launching grenades at the player that would clang and bounce off surfaces. In typical game developer fashion I enjoyed getting the system I had made (based off a tutorial) and setting the variables to the lowest possible to create a beast of a grenade launcher. Surprisingly enough, Unity was capable of handling far more physic simulations than I thought it would. As amazing as it was, numbers like these would only be needed in the sort of boss fight where a game-over meant buying a new computer - creating the ultimate, hardest Souls-like game known to man in the process. When a player would get near the Grenadier, it would immediately run for the player, launching grenades until it was killed. 

The main issue I ran into, however, was the grenades dealing damage. They would land near the player and detonate, doing no damage to players whatsoever. I stared at the problem for what felt like an eternity before my teacher letting me know one small error: the grenade was attempting to reference the player in the engine assets folder, not the actual scene - which is physically impossible. After fixing that error the grenades began to function. I had designed the system to emit a raycast towards the player, which would deal damage if it hit them. A system like this means that the player cannot be damaged if a grenade is behind a wall - a problem surprisingly common in many video games.


Get Nyalith

Leave a comment

Log in with itch.io to leave a comment.