HeroEditorHub icon indicating copy to clipboard operation
HeroEditorHub copied to clipboard

PrimaryMeleeWeapon getting switched from right hand to left hand somewhere and then not equipping because there is a shield in left hand

Open newcreativegamer opened this issue 1 year ago • 2 comments

https://user-images.githubusercontent.com/10817275/233792540-094a94e4-2455-4e49-a58e-08cafed796d7.mp4

See video. PrimaryMeleeWeapon is set to right hand in the prefab, but somewhere along the line, it is getting changed to left hand instead of right hand.

newcreativegamer avatar Apr 22 '23 15:04 newcreativegamer

To get around this for now, I put in a hack in CharacterSetup.cs Equip method to force the primary melee weapon renderer to be the right hand: PrimaryMeleeWeaponRenderer = BodyRenderers.FirstOrDefault(i => i.name == "ArmR[1]").transform.FindDeepChild("MeleeWeapon").GetComponent<SpriteRenderer>();

It seems to work well.

newcreativegamer avatar Apr 23 '23 21:04 newcreativegamer

Hello! Can you reproduce this with the hero editor scene? I can't know how your code works exactly.

hippogamesunity avatar Apr 27 '23 12:04 hippogamesunity