I need some help with animating

Started by PokingApples on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need some help with animating
Sun, 07/19/2020 - 07:19 (edited)

I need some help with animating, I'm trying to make a set of wings constantly flap on an entity, but when my entity is idle the animation stops.

Here's the code I'm using:

            this.arm1.rotateAngleZ = MathHelper.cos (f * 2.0F) * -2.0F * f1;
            this.arm2.rotateAngleZ = MathHelper.cos (f * 2.0F) * 2.0F * f1;

 

Thank you

Edited by PokingApples on Sun, 07/19/2020 - 07:19
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What are f and f1 referring…
Mon, 07/20/2020 - 03:13

What are f and f1 referring too? I assume limbSwing and limbSwingAmount. If that's correct, it would make sense why it would stop when idle.

To keep an animation, "continuing". You will need a constantly changing variable, perhaps f3 (ageInTicks) could work. You will need to do the math though. 

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Alright, Thanks for the help!
Mon, 07/20/2020 - 03:51

Alright, Thanks for the help!