Hello. For some reason I don't have the addAnimation method. I seem to have done everything according to the instructions, but the code
console.log(Object.getOwnPropertyNames(Object.getPrototypeOf(this.hero)));
only displays 11 class methods.

(11) ['constructor', 'updateSize', 'skeletonToPhaserWorldCoordinates', 'phaserWorldCoordinatesToSkeleton', 'phaserWorldCoordinatesToBone', 'updatePose', 'preUpdate', 'preDestroy', 'willRender', 'renderWebGL', 'renderCanvas']
0
: 
"constructor"
1
: 
"updateSize"
2
: 
"skeletonToPhaserWorldCoordinates"
3
: 
"phaserWorldCoordinatesToSkeleton"
4
: 
"phaserWorldCoordinatesToBone"
5
: 
"updatePose"
6
: 
"preUpdate"
7
: 
"preDestroy"
8
: 
"willRender"
9
: 
"renderWebGL"
10
: 
"renderCanvas"
length
: 
11
[[Prototype]]
: 
Array(0)

Here is the link to the git 🙁
yto4ka78/lags_phaserblob/master/src/scenes/gunger.ts

Related Discussions
...

It seems like you are trying to use the addAnimation method but it is not appearing in your list of class methods. Based on the context provided, it looks like you might be missing the correct setup or import for the AnimationState class which contains the addAnimation method.

Here are a few steps to troubleshoot and ensure you have the correct setup:

  1. Ensure Correct Import: Make sure you have imported the necessary Spine runtime classes correctly. For example, in TypeScript, you might need to import AnimationState from the Spine runtime.

  2. Check Class Inheritance: Verify that your class is correctly inheriting or using the AnimationState class. The addAnimation method is part of the AnimationState class, so your object needs to have an instance of AnimationState.

  3. Instantiate AnimationState: Ensure that you have instantiated AnimationState correctly in your code. For example:

       this.animationState = new spine.AnimationState(animationStateData);
  4. Add Animation: Use the addAnimation method on the AnimationState instance:

       this.animationState.addAnimation(0, "animationName", true, 0);

Here is a sample code snippet to illustrate the setup:

import * as spine from '@esotericsoftware/spine-core';

class Hero {
    private animationState: spine.AnimationState;

    constructor() {
        const skeletonData = ...; // Load your skeleton data
        const animationStateData = new spine.AnimationStateData(skeletonData);
        this.animationState = new spine.AnimationState(animationStateData);
    }

    addHeroAnimation() {
        this.animationState.addAnimation(0, "run", true, 0);
    }
}

Make sure you have the correct Spine runtime version and that all dependencies are properly installed. If you follow these steps and ensure the correct setup, the addAnimation method should be available.