Sword Combat "Blocking"

Hi! I am trying to make a sword combat system and I wanted to implement a blocking system. Right now it checks whether the target is blocking, which works fine, but I don’t want the target to have the ability to block hits from every angle. I want to make it so the target can only block hits from a certain angle in front of themselves, but it’s also supposed to leave the target vulnerable from behind. How do I go about doing this?

You can use Dot Product for the player’s lookVector (the one blocking) and compare that to the other player’s lookVector (the one attacking), it’ll return a number between -1, and 1.

No way it was that simple! Thank you so much, it works perfectly as intended now.

1 Like

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