I am making a 3D game with Unity.
Currently, there is a state like this image.
"Gold Unko Idle" is the state of the character's stationary animation.
"Gold Unko Run" is the animated state of the character running.
The transition between these states is performed by controlling the parameters with the following code.
if (MoveDiff == Vector3.zero)
{
Anim.SetTrigger ("GoldUnkoIdle");
}
if (MoveDiff! = Vector3.zero)
{
Anim.SetTrigger ("GoldUnkoRun");
}
The Transition parameters for the two states only have one parameter each written in this code.
I'm playing the Idle animation when the character is stationary and the Run animation when it's running, but there was a problem when the two animations transitioned to each other.
When transitioning from Idle to Run, it takes about 3 round trips like "Idle->Run->Idle->Run->Idle->Run".
I would like you to make a transition normally at once, such as "Idle → Run", but that is not the case.
This round trip occurs for about 0.5 seconds after the transition begins.
So, if you look at the animation when transitioning from the stopped state to the running state, it will transition after being awkward and jerky without making a smooth transition.
On the contrary, the same phenomenon occurs when transitioning from Run to Idle.
What is the cause of this phenomenon?
I thought, "At the time of transition from Idel to Run, Idel's Trigger parameter is still true, and as a result, the transition condition from Run to Idle is satisfied and an unintended transition occurs." But I don't know how to verify this.
When using a form in which states can transition to each other like this time, is there no choice but to use another parameter such as bool instead of the Trigger parameter?
-
Answer # 1
Related articles
- c # - player production in unity (shooting game)
- c # - [unity] i want to paste multiple textures on a game object
- scene transition due to unity roulette results
- c # - unity 2d breakout: i want to double the score for consecutive hits
- c # - i want to transition to the result scene when the song finishes playing
- c # - error when creating unity class
- c # - [unity] object reference not set to an instance of an object error resolution
- c # - i want to stabilize the processing cycle of unity
- unity - gui error: an error occurs when creating a folder or script
- c # - i want to get 5 items in unity and display the clear screen
- c # - unity delegate basic cs0246 error
- c # - code error of script implemented by unity cannot be resolved
- c # - i want to get the text of unity toggle group
- c # - visual studio 2019 does not open when double-clicking a unity script
- c # - i can't attach a script in unity (beginner)
- unity - the game view after the scene transition is not displayed correctly
- c # - i want to make a combo attack with unity
- c # - i want to read a txt file with unity and store it in an array
- c # - the error occurs only after building openfiledialog in unity
- python - you may need to restart the kernel to use updated packages error
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- javascript - how to check if an element exists in puppeteer
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to check the type of a shell script variable
- i want to call a child component method from a parent in vuejs
I could solve it by stopping using Trigger and using Bool type parameters.
I'm not sure yet, but the cause of this symptom when using Trigger is this site (https://marudice.hatenablog.jp/entry/2016/08/27/211243)
Written in
"As you can see in practice, the Animator's Trigger parameter remains On until the Transition is resolved, so
Idle->Idle (Idle's Trigger is not used and remains on)->Run->Immediately return to Idle "
I think it's because something like this is happening.