Forum rules - please read before posting.

Run animation not playing (other suggestions for switching character movement animations welcome)

Hi, First time posting here and first time making a game. AC has been a really useful tool and while I’m a complete noob I’ve managed to work through most of my problems… although this time I’m stuck!

So.. I’m making a 2D point and click game and want my character to hold an item (a flashlight) when selected. I can’t really do this by slapping on a child item as it just looks a bit silly, so I want to change the animation. Since the character always walks I thought an easy way round this to avoid any coding was to use the “run” animation slot. So when the flashlight is selected I force “Always Run”. This animation he has a flashlights (I can get over the fact his Idle doesn’t have the light). Anyway my run animation doesn’t seem to play. I’m sure I’ve named it right. I don’t see anything in the console saying it can’t play the animation, I tried switching to double click causing run (in case it was my inventory item not correctly) but the player just moves without the animation.. occasionally a bit of the animation pops into view, like it is on a different layer. I’m sure there is a much better way of switching a players walk/run/idle animation to reflect holding an item or having a change of clothes or something) and I’d love to hear it. But right now, I’m just confused as to why my work around isn’t working. Any suggestions?

Oh and I’m using AC 1.72.2a with Unity 2019.4.4f1. Animation engine is Sprites Unity. Motion control automatic.

Comments

  • Welcome to the community, @9aul.

    Your Animator window is a bit too zoomed out for me to see its contents, but I notice you've got a Warning message from the Console about not being able to play an expected animation. Is this related to another character?

    Switching to a "run" animation is quite a novel workaround! Though, you are free to change all of your standard animations (idle/walk/talk) etc at runtime by using the Character: Animate Action.

    If you use this Action, point it to the Player (make sure he's assigned in the Settings Manager as the default) and then set the Method to Set Standard, you can modify the name of your current walk animation from PlayrWalk to e.g. PlayrWalkFlashlight.

    If you then have all your "flashlight" walking animations named PlayerWalkFlashlight_U, PlayerWalkFlashlight_R etc in your Animator, your character will then rely on them as well. The same can be done for your Idle animations, so that he can hold the light when standing still.

  • Fantastic, that's exactly what I wanted! Just tried it out.. at first it didn’t work because I just re-named my previous “run” animations, but then I re-added them to the controller and perfect!. This is really useful since I’m sure as I get on with my game there will be more and more ways I want to change the walk, talk and idle animations. I’d had a look around on the forum before and must have missed this, instead I found people doing way more advanced stuff with animations with different elements assigned as bones etc. But this is perfect, thank you!

  • Happy to help. You can check out the Manual's "Character animation (Sprites Unity)" chapter for details on all features available with that animation engine.

  • Although, (not that it matters for me anymore), strangely enough the Run animation still doesn’t play. I noticed when I tired the correct method of changing the walk animation the console printed that it couldn’t find my animation, hence I just re-added it to the controller and it worked. If I try out the “run” animation, either by constraining the player in an action list or using double click, then nothing comes up in the console (yes that previous error you spotted was referring to a different character). The run animation is briefly played but then seems to be overridden with the walk animation. Like I said I don’t think I’ll be using Run, so this doesn’t matter for my work, but just in case there was an obvious solution/ if someone else has the same problem in future.

  • This occurs before you change the "Walk" animation with the Action?

    Looks like it should work from the screenshot - if you open up the "List expected animations?" foldout, it should list all four run animations that look to be in your Animator Controller.

  • OK I found out what it was! After exhausting all my ideas, making a new controller etc... I saw the "minimum run distance" setting!..

    Everything is pretty small in my game.. so the minimum distance of 1 was further than I was clicking so the character just walked and didn't run. Hence no errors, as everything was running exactly as it should.

    But I'm so glad I'd overlooked this, because I probably wouldn't have asked about switching the walk/talk/idle animations. Thanks for the help! I'm excited about using this feature some more. and Hopefully I'll be putting a demo or trailer of the game in the forum soon.

    Thanks.

  • I'd recommend keeping to Unity units as best you can, i.e. 1 unit = 1 metre, as that's what AC's default settings are based around. You can drop in the 2D Demo game's assets, e.g. the BrainIdle_D character sprite, for comparison.

    Then again, if things are now working as they should, and you've made enough headway, you're probably good to leave things as they are.

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.