I added a throttle to the Movement Animator so that characters can be set to walk or run. In the interest of keeping the Animator complete separate from the Agent and AI code, Mover also received two new methods called Walk and Run which invoke events of the same name exposed to the inspector: These […]
Monthly Archives: November 2020
Refining the Player Controller
Player Controller Player Controller has two methods: Interact With Combat Interact With Movement These jobs need to be mutually exclusive with preference given to the Interact With Combat method. Cursor To World MerlinsBeard.PlayerControls.CursorToWorld Cursor To World is an abstract class that serves as a base class for the Click To Move and the Click To […]
Patrolling Enemies
Root Motion vs Nav Mesh Agents I did a deepish dive into this topic on Zombie Runner and forgot about it when I wrote the patrol code for Bossk. He was hanging up on the corners and I suspect it was because the agent was moving faster than he was or something like that. My […]
Stat Bars
HUD Bar Component A HUD bar is composed of two equally sized images. The bar image is resized according to a percentage value passed to the Bar. The key to this is using the Size Delta property of the Image Rect Transform. Ammo HUD Component A Bar HUD can be added to any Canvas and […]
Death to the Capsule!
The objective here was to create a target dummy for me to shoot with my laser gun. The target needed a GUI health component and a score when it dies. I wanted to mock this up fairly quickly and this is what I came up with: The Target Capsule The Target Capsule has three core […]
Ammo Use: Laser Rifle
Energy Ammo Component First, this thing probably needs to have most of its functionality abstracted into a base class called Ammo. There’s a lot going on here that any kind of ammo could use. Of note are the exposures of several private fields via public getter properties. This was necessary because the Weapon is being […]
Basic Attack Mechanism
It’s a frickin’ laser beam! Handling the Input What I thought I needed to deal with: What I actually needed to deal with: The short of it is that everything is an axis in the Input Manager which apparently means that everything returns data from Get Axis Raw. The Attack Sequence The goal of the […]
Easy Character Movement
Easy Character Movement is a physics based movement controller from the Unity Asset Store. The current version has an import bug in that it renames all the layers. This is annoying. So, to get it running as fast as possible, the first thing I did was load up the Custom Character Controller Example scene and […]