Difference between revisions of "IsAttacking"
Jump to navigation
Jump to search
no edit summary
imported>Shademe (→Notes: Returns true while power attacking) |
imported>SpookyFX |
||
Line 8: | Line 8: | ||
== Notes == | == Notes == | ||
* Will return 1 while the player is attacking, sometimes even longer than [[IsCasting]]. | * Will return 1 while the player is attacking, sometimes even longer than [[IsCasting]]. Thus this will not work: | ||
if MyRef.isattacking == 1 && MyRef.iscasting == 0 | |||
message"I am attacking but not casting!" | |||
endif | |||
Use this instead: | |||
if MyRef.AnimPathIncludes "attack" == 1 && MyRef.AnimPathIncludes "cast" == 0 | |||
message"I am attacking but not casting!" | |||
endif | |||
* Will return 1 for a few frames while the player is power attacking as well. In cases where a normal and a power attack is to be differentiated, [[onControlDown]] and [[isControlPressed]] can be substituted for [[isAttacking]] and [[isPowerAttacking]] respectively, with appropriate checks. | * Will return 1 for a few frames while the player is power attacking as well. In cases where a normal and a power attack is to be differentiated, [[onControlDown]] and [[isControlPressed]] can be substituted for [[isAttacking]] and [[isPowerAttacking]] respectively, with appropriate checks. | ||