I apologize in advance if there is something obvious that I'm missing due to my own lack of experience. I read through all of the forum topics on Mecanim and didn’t see the question I have.
I’ve followed the Mecanim tutorial and so far everything is working just fine. The only issue is since the run state isn’t connected to anything, my character will just pop back into their idle state once they stop moving. It’s something minor, but it looks awkward to me because it’s so sudden. So my question is, is there any way to transition from the run state to the idle state, so that the character will come to a more natural looking stop?
If I connect the run state to the idle state and leave Use Play ticked, the character will play the run animation and then play the idle animation, even if I’m still moving. I imagine that if this can be done, it can be done via parameters, but the truth is I don’t really know how they work within ORK. What parameters I've tried have simply resulted in ORK playing the walk animation instead and the run animation not being triggered at all.
Any help or insight would be greatly appreciated, thanks!
E.g. having a bool parameter that is set to true while the combatant is running (i.e. when the run animation is played, set it to true - when it's stopped, set it to false). Add a check to the transition back to the idle animation for that bool to be false.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I’ve been messing with the bool parameters and my issue now is that I can’t figure out how to set the parameter up properly in ORK.
Here is my setup at the moment:
Idle is the default animation. The condition to transition to Run is a bool called running. It is set to false. It is set to ‘Use Play’ within ORK under the Base/Control, Animations tab.
Run is also set to ‘Use Play’ within ORK. It’s condition to transition to idle is running set to true.
I’ve tried several different combinations of Set Parameter under the Animations tab in ORK, and still can't get it to work right.
The closest I’ve gotten is my character will stand idle no problem and will begin to run when I put in the proper key input. However, they eventually complete their run animation and will then immediately transition to the idle, even if I’m still holding down the inputs to move. What I’ve been unable to figure out is, I need the bool to switch only after I release the key to move. Instead, as of right now, it’s toggling at the wrong point.
I'm sure this is a matter of me not knowing what check boxes to tick in ORK.
If I try to switch the bool from the way it's currently set up, the run animation will trigger immediately.
The run animation is set to looping.
Right now, I still assume that it's a matter of the bool toggling upon the run button being pressed, rather than when it's no longer being held. That's just my assumption though, since I have no idea how it's coded. I need to know how to properly set up the parameters within ORK's animation system to play the transition on button up rather than on button down.
In my project, my WASD movement keys are set to Hold (using key codes), and the booleans trigger just fine on my mecanim disaster of a controller. Can you post some screenshots of your setups?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
GIL, can you elaborate on the Auto Move Speed Parameters setting? I tried setting up a float, but I'm having the same issue where the transition happens while I'm still holding run, rather than after I've let go of run.
Thanks to everyone who's tried to help me with this, I'm convinced that it's something minor that will seem obvious once I've got it working.
First up, my controller for movement:
Walking and running are bool parameters - true to start, false to end.
Here's one of the input settings for the A&D keys. Same idea applies for W&S.
I also have controller setups, which are then all combined into two Input Settings labeled "Horizontal" and "Vertical"
Then under Game Controls,
Animations settings for Walk
'
And for Run
And then finally on the player combatant:
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!