- Изменено
How to start animation blending?
Hello. Can you help me with blending in unity? I cant find any command to do this. Here picture to explain what i want
I want start blending when animation reached OUT trigger and finish mixing on IN trigger.
(I cant use unity animator).
I am not 100% sure I completely understand the question and what are your exact goals, I have a few speculations what you might be looking for.
Option 1:
Are you talking about something like this AnimationState.AddAnimation, where you could add the in the queue an animation after animationDuration - 10 * 0.01666
or something like this?
Option 2:
If Out
and In
events from spine, you could register for them and use SetAnimation directly. To register for the event you could subscribe for use this
In both cases you shall properly configure the mix duration for the animations (either for the default or each separately), as shown here
If this was not what you were looking for, you might need to elaborate further.
vhristov написалI am not 100% sure I completely understand the question and what are your exact goals, I have a few speculations what you might be looking for.
Hi. Thanks for answer and sorry for my English. There is unity animator
In Inspector a can set moment when transition will start. I'm trying to do something like this, but I cant use unity animator. I need to controll time when transition will begin.
I think I now understand what you might need.
I think that the SkeletonMecanim might have what you are looking for, but I have never personally used it I cannot help you there. As far as I have understood it it shall have something like unity's root motion and mecanim support, which I think had something like the animator support. (sorry that's all I know here)
Of course the other option would be to create yourself a StateMachineBehaviour which will drive the mix duration and the animation as per the settings you have configured. I am again not sure how that could be implemented as I don't remember if unity was providing the duration of the mix itself.
Based on what your actually need, Unity's Timeline + Spine's Timeline Extension might be suffusion to control the animation. It works flawlessly for cut scenes, not sure if it can be used for something more complex.
Thank you. I will try.
Thanks @vhristov for chiming in!
TeT написалIn Inspector a can set moment when transition will start. I'm trying to do something like this, but I cant use unity animator. I need to controll time when transition will begin.
Sorry for the late reply, I just came back from vacation. I have a feeling that the mentioned solutions might be far more complicated than necessary.
@TeT could you please specify what exactly you mean by "cant use unity animator"? Could you also specify what you want to accomplish since you describe "I need to controll time when transition will begin". Do you want to change the offset to be 10 frames in some cases and 15 frames in others via script? And if so, why?
Please note that using SkeletonAnimation
with the AnimationState API provides more control over any transition timing behaviour. So if you are evaluating whether to use SkeletonMecanim
with the Mecanim API, you might be better off using SkeletonAnimation
instead.
Harald написалThanks @vhristov for chiming in!
TeT написалIn Inspector a can set moment when transition will start. I'm trying to do something like this, but I cant use unity animator. I need to controll time when transition will begin.
Sorry for the late reply, I just came back from vacation. I have a feeling that the mentioned solutions might be far more complicated than necessary.
@TeT could you please specify what exactly you mean by "cant use unity animator"? Could you also specify what you want to accomplish since you describe "I need to controll time when transition will begin". Do you want to change the offset to be 10 frames in some cases and 15 frames in others via script? And if so, why?
Please note that using
SkeletonAnimation
with the AnimationState API provides more control over any transition timing behaviour. So if you are evaluating whether to useSkeletonMecanim
with the Mecanim API, you might be better off usingSkeletonAnimation
instead.
Hello. Thanks for answer.
I cant use Unity Animator in this project.
I try to controll animation like transitions in Unity Animator. In Animator I can set moment, when transition will start and transition duration. But in AnimationState I can set only transition duration.
(Sorry, It very hard for me to explain it in English ((( )
You can set the delay
to a negative value in order to offset the start of the transition.
Please check out this video section, explaining the effect of positive, 0 and negative delay:
https://youtu.be/DxDZtTK2nlE?t=286
Note that you can also set this at the returned TrackEntry, not only when adding the animation.