November 12th 2020 by SDGNelson
126.96.36.199 update with weapon stances, one-handed animations, lasers, and more!
Each weapon can support one-handed and/or two-handed stances. You can equip a weapon that supports both in your dominant hand slot to use it with both hands, or in your subordinate hand slot to one-hand or dual-wield. The pistol is fully animated now with left, right, and two-handed animations. Certain actions like reloading require both hands and work properly when a different item is in the other hand, whereas others can be performed simultaneously like changing your attachments.
Rather than lazily mirroring the denizen mesh, the animation is now mirrored at runtime for body and weapons separately. This means text and symbols are not backwards on left-handed characters. 3.0 actually has a workaround for this where the shirt and pants textures are horizontally flipped, and then the left-handed flip corrects it, but this is the proper approach because it allows weapons to be used in vehicles.
While doing this I also decided to manually animate the left and right one-handed weapons separately (rather than automatically mirroring them) because one arm should be further forward than the other, and this gives them some nice visual variety... though it is a lot more work.
The only left-handed hack now is that the gun itself is flipped horizontally, but the only alternatively would be to animate left-handed usage separately creating twice as much work. To make this feel better though I flipped the bullet casings in the HUD to eject leftward.
Melee swings in first-person temporarily blend to copy the third-person pose. It can look odd at times, but the intention is to better convey the weapon range and exactly where the blade will hit. I want to experiment with tricks like this in order to make first-person a better default.
The disconnect between lasers following the crosshair as opposed to the weapon model has been a prevalent piece of Unturned feedback for years. In my opinion it has always been important for the laser to represent where your aim really is pointing however - especially with crosshair disabled. One of the biggest variances between weapon model and true aim is third-person where your aim must be slightly corrected to intersect with the middle of the screen.
In order to get the best of both approaches I started with the true aim rotation as a base, and applied the weapon animated rotation relative to its idle pose on top of that. Funnily enough this necessitated a "laser" bone which is part of your chest for tracking weapon space. The laser's position relative to the muzzle is then offset, so a laser on the left side of your gun will appear to the left of your crosshair dot.
Going forward I intend to add other types of laser (e.g. infrared) with different effective ranges (currently 350m), battery usage, and randomized colors. Right now the dot itself is only visible to local players because other player lasers will need some sort of prioritization and lower quality fallback, but that will be on the roadmap. It would also be interesting for the beam itself to visible in certain circumstances like fog.
All of the pistol animations were made in Blender! I converted the denizen over from Maya and built a basic rig, but it could use some improvements. In particular it is oriented along +X axis to match Unreal forward, but should be changed to -Y in order to work with Blender's X-axis mirroring... sigh.
Added Civilian tactical laser item. Two-handing of one-handed weapons when equipped in the dominant hand. Time dilation / slomo command. (/slomo #) Infinite ammo command. (/infinite_ammo) Windows shortcut to the AppData folder. Horde wave (/horde_wave) and money (/horde_money) commands. u4.unlock permission which allows lock/unlock admin interaction. Changed First-person melee animation blends toward third-person animation during swing. Left-handed mirroring is done in the animation graph rather than the mesh. Equip in dominant hand interaction takes priority. Raised minimum framerate limit to 15 from 1. Brake slightly while vehicle is empty. Fixed Per-weapon input bindings are reset after dequip rather than before equip. Drone loses track of target when too far out of range. Third-person interactor tick order. Using vehicle ignition while exiting driver seat.