Hi, I was wondering if the integration with Text Animator is still valid?
https://adventurecreator.org/forum/discussion/13732/integrating-text-animator
I tried to use the system as showed in the previous post but I am having issues with Text Animator 2.3.0 together with Adventure Creator 1.82.1.
I would like to use Text Animator styles in the Subtitles UI menu (with Text Mesh Pro). All the text which I tag (for instance with is not visible when the dialogue plays, but I can see the animation correctly from the preview in the Text Animator - Text Mesh Pro component (from Text Animator plugin).
Any suggestion?
Thanks.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Are you using speech-scrolling, and have you tried the very last scripted posted in that link?
Check your Console for errors - is anything related to the script / Text Animator being displayed?
I tried both with and without speech-scrolling. I tried the latest version of the script in the link (the one on update). I tried also to create a duplicate of the Subtitles Label (without text Animator) to receive the speech from AC and then to copy and paste the text to a Label with Text Animator and it seems that the script is not really updating the text. I added the script to the Subtitles Canvas and dragged the target Text Animator into it via Inspector. No error in the console related to script and or Text Animator.
https://drive.google.com/file/d/18_clEPux-eK3aYV5erssHIrPdQbDjWsG/view?usp=drive_link Here is a video of the issue. The text breaks when it reaches the tag. This is with the Text Animator type writer but it does the same with the speech-scrolling. Using the latest script in the previous link on the Subtitles canvas.
Is that to say it works correctly when no tags are used in the speech text?
If so, what is some example text inside the speech Action that causes an issue?
I tried more combinations. I can see two main behaviours:
1) Using Text Animator Typewriter component
Result: No Text is displayed at all, ever.
https://drive.google.com/file/d/1WryvJOrfWmg1ZUsbnmHg898M5q1HxmdF/view?usp=drive_link
2) Using Adventure Creator Scroll speech + Text Animator without typewriter
Result: Speech always works excepts if it tries to type a text animato tag ( in the example below) then it doesn't display / type animore the rest of the dialogue. Of course if the tag is at the start of the dialogue nothing is displayed.
https://drive.google.com/file/d/1bMWG1B-4LAjA68XMY_kl6HLq2eFu6kwa/view?usp=drive_link
I tried both with or without your code (Text animator speech component in the screenshots). The result doesn't change.
The text in example was:
E' chiuso. <shake> E puzza.
There's a list of accepted rich text tags in the GameEngine's Dialog component, e.g. <i>, <b> etc. Do these tags process correctly?
I tried <i> and <b> with Text Animator component and Your Script. They both work perfectly. https://drive.google.com/file/d/10NUuTOC3t-1p03d-pIAXYV_3ou-ma3Y5/view?usp=sharing
I added on the GameEngine Dialog component in a scene and now the tag is working. Is there a fast way to add the new tag to GameEngine in all the scenes? Thanks.
Update: If I useText Animator typewriter component the text is not visible at all. If I use AC scroll text I can see the text correctly and the Tag effect is applied BUT only after the dialogue line has been fully written. If I do not use any kind of typewriter AC or Text Animator the effect is applied but it is not animated.
Is the TMPro text component linked to AC? If you're using the script in the other thread, it shouldn't be so that the script has complete control over it. In this case, however, the typewriter effect option will have no effect.
You could incorporate this into the script by adding this to the Update function:
For reference this is the code i'm using. I had some debug. It looks like it is not triggering Startspeech at all.
public class TextAnimatorSpeech : MonoBehaviour {
public Febucci.UI.TextAnimator_TMP textAnimator;
I created a new text mesh pro UI component Text(TMP) to assign the Subtitles to (as Subtitles doesn't allow me to set it to None for some reason)
https://drive.google.com/file/d/1ACY_k_AVJOUF0FltmXH74hq7Fj3JPCyD/view?usp=sharing
This is where I added the Text Speech code:
https://drive.google.com/file/d/19IyL5nqhChrdZOsLGv4tybMv2GOsGoMX/view?usp=sharing
Text(TMP) is getting the Speech text
txtSubtitles gets nothing at all.
I tried to comment the if in the code:
if (activeSpeech == null || !activeSpeech.isAlive) return;
When the speech is active "textAnimator.GetComponent<TMPro.TextMeshProUGUI>()" triggers a null reference
That may be the issue. Does it work if you add this to the start of Update?
Alternatively, does it work if you map the Label element to txtSubtitles (not Text (TMP)) and remove the script?
With the new bit of code the txtSubtitles is now updated with the speech text.
However the Text Animator Typewriter component still not works. So if I deactivate AC scroll text txtSubtitles is empty during Speech Dialogue lines.
If I keep Scrool Speech Text? true I can see the text appearing but the Shake effect takes palce only after the whole text is displayed as oppose as during the text typewriter animation.
I tried to get in touch with Federico, the dev from Text Animator. He said:
"Could you please ask to their developer(s) if there's something that overrides the text? If that's the case, it should be removed/disabled :C (like a typewriter or similar)"
I thought that if I uncheck Scrool speech text? in Subtitles Speech Manager, Text Animator Type writer component should take over?
Sorry to take so much time from you @ChrisIceBox. If integrating the two thing is too complicated I can give up and try something different. I would just like to have a way to make the text appear in a "shaky" way, like a ghost is talking.
The intent behind the script is to ensure that the text displayed is unaffected by AC's regular speech text. With it, you should not need any Label linked in the Menu - it will read the speech text from the script only.
What are your Debug.Log statements from earlier showing now? Does StartSpeech get called, and is the scrolling text updated in the Update loop?
With scrolling enabled, the alternative approach would be to use:
This last code did work as intended! Thank you so much @ChrisIceBox .
For future reference and to sum it up.
To make the Text Animator work I did:
1) Added the Text Animator tags that I want to use (shake) in the GameEngine > Dialog component in each scene;
https://drive.google.com/file/d/1mEs43ageLoxX7GCmYJII7jloA9Xvsv7L/view?usp=drive_link
2) Set the Speech manager Subtitles at Scroolspeechtext? = true
https://drive.google.com/file/d/18RalWJM7BUqWzynOc6JBQlRUD7HhhdaD/view?usp=drive_link
3) Add your script to the Subtitles UI prefab (and dragged the reference to the Text Mesh Pro to it.
https://drive.google.com/file/d/1RSG3LcSMgqXz-VyHP8qp68DgoSNwQ0CG/view?usp=drive_link
**4) Result:
https://drive.google.com/file/d/1uYaxHd95NzHTCbO3BD7XLfSnzupOOn5u/view?usp=drive_link