Hi there,

I'm having an awful time trying to get movement in turn-based battles to work properly. I'm using Mecanim and have wired up the controller as per the tutorial. Basically, there's two problems.

A.) Run animation isn't playing (I don't actually care that much about this bit but maybe it's related). Idle anims and attack is fine.
B.) I got the player to translate to the center of the battle during an attack and then back to the base waypoint, except he only goes halfway back. (???) Then the enemy only comes forward half of the way to the centre, and moves back half of that.

Been wasting the day trying to get this to work, ticking and unticking things and changing speed values etc... but it's starting to drive me up the wall now. :(

Any ideas?
  • A) Are you using ORK's auto animation for idle/movement?
    If so, try enabling Use Position Change in the combatant's movement settings.
    Also, make sure to set the combatant's animation System Type to Mecanim as well :)

    An alternative to auto animations would be using ORK's animation setup to pass on the horizontal movement speed to Mecanim as a parameter and let your animator controller handle this.

    B) Hm, are you using a setup like in the game tutorials (return to base battle event)?
    Can you give me some details on your general setup - e.g. how are the combatants moved (character controller, rigidbody, transform, etc.) or what's the event setup (if you don't use it like in the tutorial).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Hey thanks for the fast reply! :)

    Basically I've been following the full game tutorial but trying to use Mecanim instead of Legacy so hopefully I haven't missed any critical setups...

    A.) I've checked auto animation on the combatant and set the system type to Mecanim. I'm also using position change. The speed is lightning quick though, maybe because of scaling on my scene objects. I've had to reduce the movement speeds to 0.3, 0.6 and 0.9 for the movement to look way more normal.

    The other complication is that I'm transitioning between two idle animations in my controller as default. Maybe that needs to be wired up a bit differently (as in duplicating the transitions to Idle State #2 as well)?

    B.) Yeah, I'm using the Return to Base type event as described in the tutorial. It's getting even weirder too as the enemy seems to travel less and less each time I run the game! -- So, in writing this reply and double-checking stuff, I changed the Return to Base event to use time instead of speed. And that essentially fixes it... (while not having changed the move to target event that still uses speed, curiously)

    The other artifact I have is that the sparks display at +1Y of my target which is way above their head, and they're about the full size of my enemy, so I'm guessing my scale is making things weird again there. (Because I'm using different store assets, one prefab is scaled to 5,5,5 and the other to .13,.13.13 #awkwardface)

    Oddly, sometimes they'll play at the correct height, like maybe 1 in 10 times I run the test.
  • I assume you also use your own models with a Mecanim setup for this? The game tutorial's characters are not set up for Mecanim :)

    A) Hm, the auto animations would definitely clash with your two idle animations - also, if your custom controller is also handling animations, that'd clash with the auto animations as well.
    I'd need more details on your controller, e.g. what kind of animation is it handling, etc.
    Probably using the alternate way I suggested in my previous post (i.e. forwarding the speed as a parameter instead of auto animations) is a better option here.

    B) I think that's also due to the high move speeds and the scale of your scene objects.
    When moving by speed, try using Stop At Target and Secure Move.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Yeah, using "my own" models. ;)

    So, basically it should be either animation controller + pass on speed param (I'm not actually sure I understand what all the settings should be tbh -- just no Auto Move and no Use Position Change?)

    OR

    Auto Move with Use Position Change and (possibly) Stop At Target and Secure Move enabled.

    If I do the latter, what does it mean for my animation controller? I tried to set that up like the Mecanim tutorial instructed. (i.e. Run in the animator not connected to the other states and set to Cross Fade with no trigger in ORK)

    I had some success with putting in the clip names but movement still doesn't play, I'm reasonably sure multiple idle states are the culprit though. I'll test with just a single state.
  • Use Position Change is generally never an issue - this just calculates the combatant's actual movement speed by the position changes each frame instead of getting it e.g. from a character controller or other components (where it might use the wrong component that has 0 speed because it's not used for movement).

    Using the Auto Animations, ORK will handle playing idle and movement animations for you based on the movement speed. This is best used with the legacy animation system.
    Using it with Mecanim can lead to issues based on how your animator controller is set up. Generally, the animations are here either played directly (or at least tried to play) or via the parameters you set up for them - and the animator controller reacts based on it's setup.

    Using the Auto Move Speed Parameter with Mecanim animations will forward the combatant's movement speed to the animator controller and you can handle the animations based on that. This is usually the better option for Mecanim animations and gives you full control over how this is working, also in relation to other animations (transitions, etc.).

    You can also use neither of those and have the movement animations played via a custom system.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ah OK, thank you, it's a lot clearer now for me. I'll have another play with it. :)
Sign In or Register to comment.