if (Input.GetKeyDown (KeyCode.D)) {
//movementController.ResetTrigger ("moveForWard");
movementController.SetTrigger ("moveForWard");
}
if (Input.GetKeyDown (KeyCode.A)) {
//movementController.ResetTrigger ("moveForWard");
movementController.SetTrigger ("moveBack");
}
i was trying to control player movement by keyboard like “Taken 3” Game like if i press (D) move forward.i used tigger to switch b/w from idle to move forward animation states.but after pressing (D) key its not trigger back to idle state its stuck on move forward state.i uncheck the hasExit time i also tried resetrigger i also used input.getkey(keycode.D) but still stuck on move forward animation problem.
For something like that, I would try creating your transitions from the Any State box rather than the Idle box. I’d have three triggers: moveForward, moveBackward, and stopMoving. If the D key was down, I’d set the moveForward trigger. If the A key was down, I’d set the moveBackward trigger. If neither of those keys is down, I’d set stopMoving.
Then, in the animation, I’d create a transition from Any State to WalkForward and trigger it from moveForward. I’d create another, similar transition for WalkBackward. Both of them would have a transition to Idle that was triggered by stopMoving.