Trial of the Gods
VR physics-based weapon combat and a shared enemy state machine, built in Unity.
- role
- :Gameplay programmer
- engine
- :Unity — C#, XR Interaction Toolkit
- year
- :2026
TODO — rewrite in your own voice.
A Unity VR project centred on physics-based weapon interaction, built with the XR Interaction Toolkit.
design
Weapons are objects before they are verbs. A weapon that sits convincingly on a rack and has weight when you lift it does more for combat feel than any amount of damage tuning, which is why the physics work came before the combat work.
implementation
weapons
Weapons hold position before they are grabbed using RigidbodyConstraints.FreezeAll
rather than isKinematic, which avoids fighting XRI’s own capture-and-restore
logic — a fix that came out of a long debugging pass on drop events not firing.
enemies
Multiple enemy types share a single EnemyStateMachine while keeping independent
configurations. Skeleton-specific code paths are guarded so empty Inspector fields
skip them entirely, which lets new enemy types extend the system without touching
what already works.
Animation events reach the weapon hitbox through a relay component on the Animator
object, since the skeleton’s sword has no Animator of its own. Death dismemberment
swaps in a nested broken-skeleton prefab via Die() overloads.