cocos / cocos-tutorial-mind-your-step

Cocos Creator learning tutorial
77 stars 57 forks source link

It doesn't jump #9

Open LocoUnPocoNadaMas opened 1 year ago

LocoUnPocoNadaMas commented 1 year ago

I'm stuck in adding character animations

 if (this.BodyAnim) {
            if (step === 1) {
                this.BodyAnim.play('oneStep');
            } else if (step === 2) {
                this.BodyAnim.play('twoStep');
            }
        } else console.error('BodyAnim is null!');

everytime I receive in console "BodyAnim is null!" In first versions works fine, but after cocos creator 3.1.x its broken. Can you help me? Now I'm using 3.7.2

9t8 commented 7 months ago

The code looks correct. Check if your animation names match and if Body Anim is set to the capsule in the editor.