cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

spine隐藏时调用setAnimation报错

Open kaxifakl opened this issue 9 months ago • 2 comments

Cocos Creator version

3.8.3

System information

Window 10

Issue description

1.节点一开始active=false,调用setAnimation播放动画,此时会报错

    protected onLoad(): void {
        this.skeleton.setAnimation(0, 'run', true);
        this.skeleton.node.active = true;

        console.log(this.skeleton)
    }

image 2.手动调用skeleton初始化,此时不会报错,但动画不会播放

    protected onLoad(): void {
        if (!this.skeleton._skeleton) {
            this.skeleton.__preload()
        }
        this.skeleton.setAnimation(0, 'run', true);
        this.skeleton.node.active = true;

        console.log(this.skeleton)
    }

Relevant error log output

No response

Steps to reproduce

打开上传的项目,运行scene场景

Minimal reproduction project

NewProject_383.zip

kaxifakl avatar May 23 '24 08:05 kaxifakl