#Could I get some help getting Cap animations to play properly?

1 messages · Page 1 of 1 (latest)

viscid sapphire
#

I've been trying to get the cap animations for the bro's hat lifting off their heads and landing back on for days now, but I still cant seem to solve the main issue of the animations playing correctly. The code is simple and i know it works, and I have a video to show you that it does work, just not the way I want it to.

#
#include "nsmb.hpp"




ncp_hook(0x021060DC, 10) // I put overlay 10 but it might be in a different overlay.
void SMWCapBehavior(Player* player) {
    bool isMarioFalling = player->velocity.y < -0.2fx; // check to see if mario goes below -2 velocity on the Y axis.
    bool hasMarioLanded = player->collisionFlag.ground;
    if (isMarioFalling) {
        player->model.flags = PlayerModel::Flags::RenderSeparateCap; // render both mario and his cap seperately
        player->model.cap.animation.init(0x4, 0); // initalize the cap falling animation
    
    }
    if (hasMarioLanded) {
        player->model.cap.animation.init(0x3, 0);
        
    
    
    
    }
}
#

this is the code I have rn, and it works perfectly fine when the animations are flipped (put on when fall, rise when land) only by swapping 0x3 for 0x4 and visa versa

#

Video to show what I mean