Trying to make my enemies block sometimes

tryin to make my enemies block some of the time… so far i’m using Random.Range in the update function but HA he blocks and stops blocking a million times a second
I’m thinking its going to involve a coroutine or invoke repeating but im not sure how to implement it exactly.

Shouldnt the re-action of blocking be in response to the action of being attacked?

I’d start with that, respond once to the attack event and within that response determine the likelihood of a successful block. If successful, perform a block.

1 Like

ya that’s a good idea… i’ll probably implement something like that… but so far it seems pretty realistic even just with the random.range on a wheel of actions…
plus in my context i need them to block sometimes when not being hit because i sort of have a rock/paper/scissors game going on with blocking/regularAttack/PowerAttack

the game Jade Empire for original xbox had a great system like that… real simple but made gameplay pretty interesting.

1 Like

Ah I see… sounds like you’ve made some progress with this since posting your question, can it be marked as solved now Spud? :slight_smile:

1 Like

absolutely! sorry, forgot!

Just needed a Coroutine with a bool isActing being set before and after a yield return WaitForSeconds()

1 Like

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