u/Haytam95

Image 1 — I did some black magic to resolve weapon positioning in my beat em up
Image 2 — I did some black magic to resolve weapon positioning in my beat em up
Image 3 — I did some black magic to resolve weapon positioning in my beat em up

I did some black magic to resolve weapon positioning in my beat em up

I have some 2D characters, with their animations done frame by frame. Also, I have some static weapons that I need to dynamically attach to the characters, without duplicating every animation per character per weapon.

So I went with a quite strange solution, that seems to work: For each texture, I created a secondary texture of the character, but all black with two dots.

The blue dot indicates the pivot point, the red dot is used to calculate the Atan between these two and get the radius. Then I built a custom editor, that searches for all the sprites with secondary textures and loads all the baked positions in a centralized scriptable object.

Finally, the WeaponHolder script reads this scriptable object and based on the current sprite (running in the animation), sets the weapon position.

All in all, it works! Some weapons can override character animations, so specifics can be handled as well

u/Haytam95 — 3 days ago

I built an in-house UI Toolkit framework for Unity where each view is self-contained and bindings work without MonoBehaviour components

The goal was to avoid attaching MonoBehaviours everywhere just to wire buttons, labels, and state updates, but it eventually grew into a full UI framework with lifecycles, screen transitions, overlays, and providers.

I usually work with Angular, so I reused some of its concepts and naming, like ViewChild (Query), Inject (custom providers) and Directives

u/Haytam95 — 6 days ago