Forum rules - please read before posting.

Problems about player moving along the x axis

Hi Chris,

I am facing a problem about a player moving along the x axis.
I open the project with 3D environment and point and click mode.
I used the script point and click along one axis found in wiki.
All works fine, the mecanim player can walk along the axis.
However, I can't adjust the walking speed of the character by changing the speed scale in AC.
No matter what I change the speed scale value, the character moves with the same speed.
Am I getting anything wrong?

Moreover, I tried to add a walking footstep sound clip on it, but it doesn't play when the player is walking.
Am I missing something?

I am waiting for your reply, thank you very much.

Comments

  • You're referring to this one? Bear in mind that it's intended for 2D games.

    The script doesn't override the player's speed or movement sounds - are both of these issues still there even when not using the script? It may be that the script is unrelated.

    Try dropping in the 3D Demo game's Player prefab, Tin Pot, into the scene to have him override your own. Is he able to change his speed via the Inspector?

    If your character relies on Root Motion, then the "Walk speed scale" will only affect the parameter that you've mapped to the "Walk speed float" parameter in their Animator. With Root Motion, the character's physical movement speed will be based on the walk animation itself.

    For footstep sounds to play, the character must have an "SFX Sound child" assigned to them, and the character must also be considered grounded. Check that the "Ground check layer(s)" field matches the layer that the floor collider is on, and that the player's own layer is set to "Ignore Raycast".

    Without seeing screenshots of your actual setup, however, I can only give general advice. Please share more details if you need more help, including your AC and Unity version numbers.

  • Hi Chris,

    Thanks for your reply.
    I am using Unity version 2019.3.0a7
    AC version 1.66.1
    I am using Tin Pot prefab, but it has the same result.
    Changing the move speed float cannot change the speed of the Tin Pot.

    Even if I change into Direct mode, it has the same result.
    Do I miss anything?

    Thanks

  • Hi Chris,

    I have tried more test.
    Is that mean if the player is using root animation, the player moves with root animation speed regardless what the speed scale value set?
    Therefore, if I am using the root animation, I should set the walking animation threshold equal to walk speed scale. And set the running animation threshold equals to run speed scale?

    Thanks

  • I am using Tin Pot prefab, but it has the same result.

    In 2018.3 and later, the 3D Demo is updated and Tin Pot relies on Root Motion as well. You could try the 2D Demo's Player, Brain2D, in a 3D scene instead, however.

    Is that mean if the player is using root animation, the player moves with root animation speed regardless what the speed scale value set?

    Yes, the motion is driven by the animation. What animation is played is determined by your Animator, and the value of the "Move speed" float. If your Animator is on the character's root, then this will be set to the walk/run speed scales when moving. If you want to change how quickly a character walks (but still walks), consider routing the Animator to play a different walk animation with a Boolean parameter.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.