top of page
Writer's pictureDaniel Henshaw

[11/05/2022] Weapons & UI

Weapon UI:

I created a weapon canvas. This canvas is updated via a 'Update Ammo Display' script.

The weapon canvas is updated when the gun is equipped. This is done inside of the Gun script which is used as inheritance for all the weapon scripts this makes the weapon UI very versatile and useable for many different scripts.


Weapon Inverse Kinematics:

Using the animation rigging package IK cannot be updated during run time. This meant that I had to come up with my own system of updating the hand depending on the weapon the player is holding. When I looked online there was also no information of how to do this. I decided to use one set of reference grip positions and using then have separate grips for each weapon. Using the 'Update Ammo Display' script every frame I set the position of the reference grip to the position of the guns grip. This changes the hands position correctly.


Update Ammo Display Script:

Clip of working IK arms:


Evaluation:

This system works and is very versatile and reusable however, this method is very confusing. The code feels very hacky and messy. If I was to build this system again I would definitely try to find a better solution around the problems I faced (Animation Rigging not being updatable).

コメント


bottom of page