Author Topic: Understanding issues with TypewriterEffect  (Read 6599 times)

andrew2110

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Understanding issues with TypewriterEffect
« on: February 09, 2015, 03:41:22 PM »
Hello,

I've tried many things in trying to get TypewriterEffect to work properly with PixelCrushers Dialogue System and just can't figure out whats going wrong.

I did a youtube video showing how it goes wrong: https://www.youtube.com/watch?v=FmHCukAA46M&feature=youtu.be

Skipping to 14 seconds in shows the TypewriterEffect running correctly a couple of times, then a quick scene change, and then it going wrong.


On looking at the inspector, here's the text in my UILabel component when it goes wrong.

"[CE]W[00]e're in the cloud! I love being able to connect with my Terra Monsters
wherever I go."


To make the TypewriterEffect component work at all with the Dialogue System, I had to add:

"ResetToBeginning();"

in the OnEnable() function of the TypewriterEffect.

Any help would be greatly appreciated, I've tried many many things to trick this into behaving but can't quite understand why it's going wrong.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Understanding issues with TypewriterEffect
« Reply #1 on: February 10, 2015, 05:17:57 AM »
Why do you need to add that to OnEnable? Does your UI persist from one scene to another? Loading the scene normally resets everything you had in it, including the UI. ResetToBeginning doesn't make sense to be called in the OnEnable as it's already at the beginning. Unless your UI was marked as DontDestroyOnLoad, which is bound to have issues.

andrew2110

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 12
    • View Profile
Re: Understanding issues with TypewriterEffect
« Reply #2 on: February 10, 2015, 07:52:30 AM »
The Dialogue Systems UI does persist from one scene to another, that just seemed to be the only real way to get the Dialogue System working properly. Without adding the extra code to the TypewriterEffect, it would behave nicely as a Typewriter just once and then on the next time the player talks to a character or if the character has more than one line of text to say - the typewriter effect wouldn't fire again and it would just look like solid text.


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Understanding issues with TypewriterEffect
« Reply #3 on: February 11, 2015, 07:15:10 PM »
The only way to get the dialog system working properly? I'd question what you did there that didn't make it work. It's strongly advised to keep UI non-persistent. If you wish to use a persistent UI then you may need to modify some things, like the Typewriter Effect that you've found.