#Entity making movement of both Idle and Walk animation
16 messages · Page 1 of 1 (latest)
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
I have for example this. Do I need to show anything else?
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
Ok, where do I have to import this code, and what to erase and replace by it?
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.
So, this is the result. When it stays still, I want it to do Idle animation, which only for few seconds is played, otherwise its wings are sticking out, which is ment in Idle animation to not be the case.
interesting... what is your entity.idleAnimationState? i believe you are using geckolib, so there should be a PlayState mentioned somewhere
I didn't do it by Geckolib. I followed the KaupenJoe's tutorial about modding fabric mobs (the one with porcupine). I managed to edit the velocity to slightly higher number, the result is better but still has some flaws. When in idle stage, when pushed it still for few seconds shows wings.
right. how are you handling the wings then? there might be something going on there as well
Don't get what you mean with the "handling".
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
I would assume that it gets triggered like limbs by "LimbSwing" code. Somehow to affect only limbs of my beetle but not wings.
i think it might have something to do with how the model is made... not sure there