#Entity making movement of both Idle and Walk animation

16 messages · Page 1 of 1 (latest)

scenic tangle
#

Simply speaking: When my entity mob walks, it seems like it plays movements of multiple animations together, idle and walk at the same time. And I need it to do ONLY the walk animation. Any help?

rocky gull
#

have you got any predicates to check if the entity is actually walking? it would also be best if you posted any animation handler code that you have

scenic tangle
rocky gull
#

alright, what you're doing is performing your walk animation and then performing your idle animation no matter what. you should use this code instead:

if (entity.getVelocity().length() > 0.01) this.animateMovement(ModAnimations.WALK, limbSwing, limbSwingAmount, 3f, 3.5f);
else this.updateAnimation(entity.idleAnimationState, ModAnimations.IDLE, ageInTicks, 1f);

that should force the animation to be walking if the entity has some amount of velocity, and idle if there's no velocity. this will make the entity start walking if it's falling from the sky however

scenic tangle
#

NVM, I found it.

#

Now I'm testing

#

OK, it's doing the Walk animation properly, but when it stays still, it doesn't do the Idle animation anymore.

scenic tangle
rocky gull
#

interesting... what is your entity.idleAnimationState? i believe you are using geckolib, so there should be a PlayState mentioned somewhere

scenic tangle
rocky gull
#

right. how are you handling the wings then? there might be something going on there as well

scenic tangle
rocky gull
#

well the wings are only appearing when something is happening. there must be something that is handling the wings to only occur when that something is happening

scenic tangle
rocky gull
#

i think it might have something to do with how the model is made... not sure there