Creating a shield.

Hi, I’m currently working on making a Hack 'n Slash, and I’m relatively new to Unity and C#, and I was hoping someone would be able to help me create a shield for my character (that could hopefully be used for the enemy as well).

I’ve been using tons of tutorials and books, but I can’t seem to figure out how to create a shield for the player. In this case when the player presses or holds the right mouse button the player would block the enemies attacks. So if anyone could help me out on creating the shield or send me a tutorial on how to do it, I’ll be grateful. Thanks in advance!

Hmm , im not sure of your intended use , and what kind of mechanics would play out while blocking, but it would seem to me , that as for just stating blocking or not, should not be that hard. In fact the only difficulty to “blocking” mechanics in general, is deciding what mechanics play out when the character is blocking. To set a state of " the character is blocking" just use a boolean value.

Theres really not much to what you said though , as for just a state of blocking it really is that easy, use a boolean value. As for the mechanics of your block , … defense , strength, i dunno whatever other variables that play into its overall calculations… well thats where it could get tricky, thats up to you!