Add walking and idle animations

I have the animations but don’t exactly know how i should code it. i would love for help on this. here is my game: PlayCanvas | HTML5 Game Engine

I recommand this tutorials.

Anim State Graph Blending | Learn PlayCanvas

Crash Course - Make a Game | Learn PlayCanvas

i followed it but i have a couple problems

  1. i am moving on an axis but i want to move whatever direction im looking
  2. it is having trouble reading setFloat but im not sure why
    in the tutorial his did not get the error, im unsure of what i did for it to happen, any ideas

Oh, I see.

First, Look at your character bone structure.

SS2

RootNode
∟Character
∟Armature
∟ …

It has this structure.

And then, we should set up Root Bone in anim component.
Before that, let’s take a look at your character template first.

SS1

What do you think the rootbone will be here?
It’s uploads_files_blah_blah_Character1.

Finally, Set up Root Bone

SS3


Answer to second question.

sefFloat Method is inside anim component.
Therefore, to use it, you need to retrieve the entity that has the anim component.

But, the entity you set up doesn’t have an anim component.
image

Btw, “Run” animation is weird.