#how to detect an entity attack in animation controllers?

10 messages · Page 1 of 1 (latest)

round igloo
#

What condition will allow me to transition to my "hit" state if the entity is attacking?

lyric pebbleBOT
#
Welcome to the help forum!

Please make sure to read #1029468016594911232 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

wooden nymph
#

v.attack_time > 0 for melee attacks

round igloo
#

ah nevermind q seems to mean query where v means variable

round igloo
wooden nymph
#

That’s because v.attack_time is never negative. It ranges from 0 to 1: It is at 0 by default, and it will linearly increase to 1 when the entity is attacking. After wich, it will return to 0.

So either use "v.attack_time == 0", or another condition to transition, like "q.all_animations_finished"

round igloo
#

Oh, that's interesting. Do you know why this is what they do in the vanilla resource pack?

wooden nymph
#

Some hard-coded variables work in mysterious ways, but I’ve never seen v.attack_time go below zero. This may be for optimization purposes, and the transition back to the default state may never turn true. I suspect it’s just there to keep things clean, in a way.

round igloo
#

ah, makes sense. Thank you.