|
Post by Strider on Jan 16, 2018 0:45:25 GMT
Hi everyone! Happy New Year!
I wanted to ask... when rolling, the characters have invincibility, in wich part of the code is that information? can it be applied to other moves?
I'm making a parry and it works kindof fine, but when the enemy clashes with the object i create to make the parry, sometimes the hitbox collides with the character still, so i woul like to add a few invincibility frames at the start of the animation.
Thanks!
|
|
|
Post by Invector on Jan 16, 2018 0:51:11 GMT
Take a look into the TakeDamage method ;)
|
|
|
Post by Strider on Jan 16, 2018 2:31:33 GMT
Thanks!
|
|
|
Post by Strider on Jan 16, 2018 4:11:58 GMT
I did this and it seems to work:
in vThirdPersonMotor.cs around line 138 when some variables are been defined as "isgettingup" "isrolling" "isjumping" i added "inParry".
Then in vthirdpersonanimator.cs around line 65 i added
inParry = upperBodyInfo.IsName("Parry");
because i have an animation that plays before the defense animation called Parry. in this animation i summon a prefab wich is a sphere that triggers recoil in the enemies' attacks.
Then again in vThirdPersonMotor.cs around line 300 i added InParry to the list of conditions in wich the character can't receive damage.
if (currentHealth <= 0 || !damage.ignoreDefense && isRolling || inParry )
i think is working fine, but my anim is so short, it needs a lot of precise timing.
Was this the most effective way to do it?
|
|
|
Post by Invector on Jan 16, 2018 12:53:36 GMT
It's a way to do it, if it's working as expected then enjoy it xD
|
|