Run Animation Help

Working out of a testing scene (testing 2). Having trouble with adding a movements to our character. We added a running animation but want it to translate across the screen. Here are the directions we followed: Animations in PlayCanvas

Here is the editor for the scene.

@Ashley_Solano You should have the following setting in the Anim in the root of the character.


Also I see two sets of the script for Anim but one is turned off.

I’m afraid it’s not publicly accessible.

1 Like

Okay, she had one script (jumpInput) that she also declared the run functions in. We are having some issues with the script. It is done exactly how it was directed besides the translatelocalo with the key_right. It told us to use a a movement script like we did with our hero ship. But We are having trouble with the Key Up Key Down, we are not getting out character to go back to idle and pause animation when the Key is no longer being pressed. Do we need to move those to an update code? Thanks for the help, we are all still learning!

Both transitions to and from the Run state have the same condition

This means that while the parameter Run is true, it’s stuck in this loop between these two states as the condition is true going to and from the Run state.

To fix this, change the condition of the transition from the Run state to the Idle state to be Run == false

So when the Run parameter is false, it transitions from the Run state to the Idle state.

It’s what we do here in the tutorial Anim State Graph Blending | Learn PlayCanvas

Thank you! That fixed it! Last issue is what are we doing wrong as far as being able to add a directional run?

Sorry, which last issue?

As a side question, doesn’t the course provide a helpline/resource for their material?

1 Like

We are trying get the character to run and move across the plane with the directional arrows.
And No, unfortunately. We have the curriculum through a 3rd party virtual LMS system and the course is through edynamics. There is not supporting material or guides, I have to email edynamics first and then they reach out to their writers and then what is seems to be subcontractors with the course. By the time I get any feedback too much times has passed. A lot of the issues come when the course doesn’t give the exact directions it says now add something similar to what you did in a previous lesson and my students are coming up all these different errors in doing so. This is our first year using this course and using PlayCanvas, so I am trying my best to learn to work through the errors or issues and work ahead to limit them. I’m sorry if I am bombarding you with questions all the time. :frowning:

You may want to look at Crash Course - Make a Game | Learn PlayCanvas instead as it covers some of the areas that you seem to want to do and uses physics to move the character around to collect stuff

Great, thank you!

So i will able to get the code figured out and tried my own and this is what happens!.
I also was able to find an example of what the level should look like from our curriculum however they are showing a Model(legacy) and ours doesn’t have that and when I tried to add I had no options to click, so I am a little confused there. When I remove the Root bone it functions correctly but the model sinks below the plane or lays on its side.
here is the example scene of what should be happening.

Hi @Ashley_Solano! I’m not sure if it will solve any of your problems, but I think your components are on the wrong entity. They need to be on the parent entity (the first characterMedium entity). Only the render component need to be on the second characterMedium entity I guess.

1 Like

@Ashley_Solano I see in whatever is the latest above that the model for the character seems to not have a rigid body or collision. Perhaps this tutorial will also be helpful.

This tutorial shows what @Albertos is saying above.