|
Post by archieandrews on Jul 16, 2019 11:48:51 GMT
Hi I'm struggling ot make my character smoothly transition from a Talking state back to Locomotion Idle State.
I have a state machine under Locomotion Named Talking that contains an Talking Idle Motion. This transition works via a "talking" bool parameter.
On the transitions to and from Talking I have Exit Time disabled.
However the character snaps between animations rather than a smooth blend (maybe I need a blendtree?)
Can you please explain how to make the transition smooth? I don't mean the time it takes but the actual transition so it happens smoothly from Talking animation back to the Free Locomotion default idle animation to the other.
Thank you ! A
|
|
|
Post by witcher on Jul 16, 2019 17:36:53 GMT
why dont you put talking under Actions
|
|
|
Post by archieandrews on Jul 16, 2019 18:24:34 GMT
Because I have no idea how it works. No idea where to set the logic on the substate etc.
|
|
|
Post by archieandrews on Jul 16, 2019 18:29:39 GMT
BTW like I've said before I dont want to use trigger or key I want to call via code.
Simply asking how do I do this but with code instead to call the action instead of using a key press?
TY
|
|
|
Post by Invector on Jul 16, 2019 18:35:31 GMT
Like witcher said, one way of doing is using the substate Actions and call your animation using this line instead of enabling/disable a bool
// the float value is the transition duration animator.CrossFadeInFixedTime(yourAnimationClip, 0.5f);
If you open the vGenericAnimation script used in the video tutorial you post, you will see that we used this line to trigger the animation, you could use animator.Play as well but we prefer to use CrossFadeInFixedTime
You can use the bool "Talking" as a condition to exit or use the ActionState which we use to handle generic actions such as this
By doing this you're making generic transitions between submachine states instead of a specific state to a blendtree, which may not generate the best result
|
|
|
Post by archieandrews on Jul 16, 2019 20:02:52 GMT
Thank you very much both of you. That sorted it!
I wasn't exactly sure how to access the invector 3rd person stuff but used the lines below. Its the whole tpInput.cc.animator .. etc etc that confuses me. Ironically the stuff I was aksing for and would like to see is simple example script documents of. ie. this does this .. this does that. But anyway learned it now so Thanks very much.
using Invector.vCharacterController;
then ...
protected vThirdPersonInput tpInput;
Then ..
tpInput = GetComponent<vThirdPersonInput>(); tpInput.cc.animator.CrossFadeInFixedTime("Talking", 0.1f);
|
|