#how to detect an entity attack in animation controllers?
10 messages · Page 1 of 1 (latest)
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.
v.attack_time > 0 for melee attacks
what's the difference between v.variable and q.variable?
ah nevermind q seems to mean query where v means variable
Hey, do you know how to cancel this? The mob starts hitting but transitioning to default with the condition "v.attack_time < 0" doesn't ever stop it
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"
Oh, that's interesting. Do you know why this is what they do in the vanilla resource pack?
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.
ah, makes sense. Thank you.