Tweening characters as they appear in the scene
Re: Tweening characters as they appear in the scene
Hi,
Sorry for the delay. I was tied up with other support requests yesterday. I'm working on it now.
Sorry for the delay. I was tied up with other support requests yesterday. I'm working on it now.
Re: Tweening characters as they appear in the scene
Here's the Spine Support package:
DS_Spine_Support_2019-05-26.unitypackage
(Exported from Unity 2018.3.0)
It uses standard Spine animation; you don't have to use Mecanim for the Spine animation.
To set it up:
1. Add a SpineDialogueActor component to your character's GameObject. (This can be an empty GameObject. It doesn't have to be the Spine character.)
2. Add your Spine character to the scene, and assign it to the SpineDialogueActor's Spine GameObject field. You can deactivate the Spine character if you want. It will be activated as needed during conversations.
3. In your Standard Dialogue UI, replace the StandardUISubtitlePanel components with SpineSubtitlePanel components.
That should take care of the basics.
To tween in/out:
1. Add an Animator to the character's GameObject (the same one that has the SpineDialogueActor component). Add Show and Hide triggers that tween the Spine character in and out. (See the example scene.)
2. Assign the Show and Hide trigger names to the DialogueActor component.
To play additional animations:
1. Add a SpineSequencerReferences component to the character's GameObject. Assign the Spine character to the Skeleton Animation field, and assign Spine animations to the Animation Reference Assets list.
2. Use the new SpineAnimation() sequencer command:
SpineAnimation(animationName, [trackIndex], [loop], [subject])
Parameters:
This example loops the "wave" animation on the speaker. At the 1-second mark, it plays the bow animation one time on the listener.
DS_Spine_Support_2019-05-26.unitypackage
(Exported from Unity 2018.3.0)
It uses standard Spine animation; you don't have to use Mecanim for the Spine animation.
To set it up:
1. Add a SpineDialogueActor component to your character's GameObject. (This can be an empty GameObject. It doesn't have to be the Spine character.)
2. Add your Spine character to the scene, and assign it to the SpineDialogueActor's Spine GameObject field. You can deactivate the Spine character if you want. It will be activated as needed during conversations.
3. In your Standard Dialogue UI, replace the StandardUISubtitlePanel components with SpineSubtitlePanel components.
That should take care of the basics.
To tween in/out:
1. Add an Animator to the character's GameObject (the same one that has the SpineDialogueActor component). Add Show and Hide triggers that tween the Spine character in and out. (See the example scene.)
2. Assign the Show and Hide trigger names to the DialogueActor component.
To play additional animations:
1. Add a SpineSequencerReferences component to the character's GameObject. Assign the Spine character to the Skeleton Animation field, and assign Spine animations to the Animation Reference Assets list.
2. Use the new SpineAnimation() sequencer command:
SpineAnimation(animationName, [trackIndex], [loop], [subject])
Parameters:
- animationName: Name of an animation asset in the subject's SpineSequencerReferences component.
- trackIndex: (Optional) Track index to use. Default: 0.
- loop: (Optional) Loop or not. Default: true.
- subject: (Optional) Spine GameObject with a SpineSequencerReferences component. Default: speaker.
Code: Select all
SpineAnimation(wave);
SpineAnimation(bow,0,false,listener)@1
Re: Tweening characters as they appear in the scene
I was going to request that, but I thought I'd burdened you too much as it is and I could have lived with mecanim. Thank you, though! I have a feeling that it's better this way.
Now excuse me while I rate your libraries 5 stars
Re: Tweening characters as they appear in the scene
Thanks!
If you notice any issues or have any feature requests for the Spine support package, just let me know.
If you notice any issues or have any feature requests for the Spine support package, just let me know.
Re: Tweening characters as they appear in the scene
Documenting as I go to help others:
You should leave the portrait image field blank in your subtitle panels and remove the actual portrait image game objects since they won't be used.
The Dialogue example depends on the Spine examples, so make sure the Dialogue asmdef references the example code if you're using asmdefs. Spine doesn't behave nicely when you import code that refers to it and the asmdef doesn't reference Spine: This removed all the actor SkeletonData asset fields so I had to add them back manually (I may have made a mistake here, since I can't tell what they were, but I assumed all actors were spineboy-unity_SkeletonData.
I have some questions:
I have this warning on the player's Hidden animation, but I don't know if it matters:
Is the subtitle panel visibility dropdown only used for the display names now, or does it do other things?
You should leave the portrait image field blank in your subtitle panels and remove the actual portrait image game objects since they won't be used.
The Dialogue example depends on the Spine examples, so make sure the Dialogue asmdef references the example code if you're using asmdefs. Spine doesn't behave nicely when you import code that refers to it and the asmdef doesn't reference Spine: This removed all the actor SkeletonData asset fields so I had to add them back manually (I may have made a mistake here, since I can't tell what they were, but I assumed all actors were spineboy-unity_SkeletonData.
I have some questions:
I have this warning on the player's Hidden animation, but I don't know if it matters:
Is the subtitle panel visibility dropdown only used for the display names now, or does it do other things?
Re: Tweening characters as they appear in the scene
Thanks for these notes. I'll add them to the manual in the next release.
It doesn't matter in this case, but the answer is that I copied the original subtitle panel's animator controller and forgot to replace that animation. The original animation assumes the panel has a Canvas Group component and sets its Alpha to zero. You could replace it with an animation that immediately positions the Spine character out of view if you want. Or you can position the character out of view at design time and ignore the Hidden animation.
It's technically used for all UI elements assigned to the subtitle panel, but if your subtitle panels are sharing the same UI elements then the elements that are shared will stay visible.
Re: Tweening characters as they appear in the scene
Ah, that's really helpful to know. Is there any place in the documentation that describes the visibility dropdown options in detail? As you can see from my other reply, that's been a source of confusion for me. I don't really understand what all the options do, and that video that shows the VN dialogue UI doesn't explain every option there is.
Re: Tweening characters as they appear in the scene
Kind of. It's documented in code, which means this API page has a table that describes the options. I'll add a similar table to the Dialogue UIs manual page in the next version.
Re: Tweening characters as they appear in the scene
Cool. A link to that may suffice because it makes sense to me.