Any benefits to passing both left and right hand transforms to the weapon?

I try to think of the way that I would implement something as I’m watching Rick go through and do the implementation. When we add in left handed transforms to the weapon, I was thinking I would just add a boolean on the weapon and a public getter “IsLeftHanded”. Then in fighter I would just conditionally pass the hand based on the boolean.

I know there is more than one way to peel a potato, but is there a particular benefit to the method used in the lesson, or are they roughly equivalent?

You never met my mother…

The problem with this approach becomes apparent if you equip a sword, and then equip a bow… If you’re only passing in the left hand transform when you equip the bow, then the WeaponConfig won’t have a reference to search for an outstanding weapon already on the character. In effect, you’ll still be holding that sword after the bow is equipped…

It’s still an excellent question, though. If not for the old weapon destruction part of Spawn(), this would be roughly equivalent.

I see. As I progressed into further lessons, it became apparent why we would need both. Thanks for the response!

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms