Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

[RELEASED] Score Flash: Easy to use GUI for Scores, PowerUps, Achievements, Tutorials

Discussion in 'Assets and Asset Store' started by jashan, Sep 26, 2012.

  1. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    @jashan - that is great I am able to work with it either way, thanks for the explanation.

    One more question, when the first score flash text is displayed there is a slight hiccup on my device, it is not really noticeable in the editor. Do you recommend manually pooling some score flash game object ahead of time to avoid this or is there something built in that I can setup?

    Thanks!
     
    Last edited: Aug 10, 2015
  2. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Yeah, under Main Layout, you'll find "Warm up Message Instantiation" which does just that.

    WarmUp.png

    This is only active if you're using a Custom Renderer (Rendering) and it instantiates as many prefabs as you select.
     
    jprocha101 likes this.
  3. ToyBrain101

    ToyBrain101

    Joined:
    Sep 15, 2014
    Posts:
    13
    Hello,

    Thank you for a great product. I am enjoying the easy fit for my game and in unity it adds a nice level of polish. I ask you how can i implement a 2d follow? I can not find any 2d discussion on this thread, am I missing it? Do you have a tutorial for specifically implementing a score int code? Please help if you have time. TY.TB
     
  4. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    I'm travelling at the moment, so it's a little difficult for me to create an actual 2D example - but that's definitely I'll look into when I get back. The good news: You should be able to achieve what you want by simply using ScoreFlashFollow3D. Don't let yourself be confused by the "3D" in there - it should work just as well for 2D :)
     
  5. ephemeral-life

    ephemeral-life

    Joined:
    Sep 12, 2015
    Posts:
    488
    Are sprites supported?
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Yes. Basically, anything that you can make a prefab of will work. If it's just a sprite, or even a sprite as a background for some text, it's very easy.
     
    ephemeral-life likes this.
  7. ephemeral-life

    ephemeral-life

    Joined:
    Sep 12, 2015
    Posts:
    488
    Great, thanks for the fast reply.
     
    Last edited: Nov 17, 2015
  8. Linus

    Linus

    Joined:
    Feb 22, 2012
    Posts:
    106
    Hi just wanted to let you know that the sample prefabs in the addon for TextMesh Pro misses TextContainer component so the sample scene does not work. At least not with the latest beta version of TextMesh Pro

    Edit. I just encountered a werid bug. The text generated does not match the content of the text field.

    see the image


    The text shown in the input box is correct. Last part is suppose to be 100 not 300

    EDIT 2:
    Following changes to ScoreFlashRendererTextMeshPro.cs (line 61) seems to have fixed it
    Code (csharp):
    1.  
    2.            // textMeshPro.text = msg.Text;
    3.             textMeshPro.SetText( msg.Text );
    4.             textMeshPro.SetAllDirty();
    5.  
    Using only SetText() should work eventually I think as it includes a call to SetVerteciesDirty() but I had toset it all as dirty for it to work.
     
    Last edited: Dec 20, 2015
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Hi Linus, thank you for the heads up. I had just recently tried ScoreFlash with the then current version of TextMesh Pro from the Unity Asset store and it worked fine. But after the last update from December 19th, I'm even getting several compilation errors.

    Previously, I've also added an example scene for using TextMesh Pro with Unity UI and I'm now working on a new version that's fully compatible with the current version of TextMesh Pro (0.1.52 Beta 3.1 (Dec 19, 2015)). I'll probably drop support for pre-5.0 Unity, though.
     
  10. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Turns out the compilation errors were actually caused by an incompatibility between TextMesh Pro and SpriteManager 2 which I also still had in the project (there's also an integration for it available for ScoreFlash). After removing SpriteManager 2, the only issue I saw was a warning regarding the Text Container that is printed out a few times in the scene 3DTextExampleTextMeshPro. But the scene still does work. The other scenes work without warnings but there seem to be some alignment issues (some of the text appears with an offset to the left / right).

    I also wasn't able to reproduce the issue you've found where the text isn't changed. When I push a message, keep the ScoreMessage instance and use msg.text = "SomeNewText"; this is correctly updated in the TextMesh Pro component.

    Which beta version of TextMesh Pro and which Unity version are you seeing these issues with?

    I did my testing so far with Unity 4.6 and Unity 5.0.2 and used the current TextMesh Pro version from the Unity Asset store. In a current project, I'm using Unity 5.3.1.
     
  11. ecequalsm2

    ecequalsm2

    Joined:
    Jan 14, 2016
    Posts:
    7
    Hi Jashan,

    I'm also having problems with the TextMesh Pro add-on example scene. I'm not sure where the text is when I press play, but I don't see anything in 2D or 3D mode. Any suggestions?

    Thanks,
    Milan
     
  12. bjornrun

    bjornrun

    Joined:
    Oct 29, 2013
    Posts:
    87
    Status for 2018.1? And with TextMesh Pro? I see errors when trying to import TextMesh Pro add-on:
    Assets/ScoreFlash - Text Mesh Pro/ScoreFlashRendererTextMeshPro.cs(21,18): error CS0534: `NarayanaGames.ScoreFlashComponent.Addons.ScoreFlashRendererTextMeshPro' does not implement inherited abstract member `NarayanaGames.ScoreFlashComponent.ScoreFlashRendererBase.NeverAssignParent.get'

    TextMesh Pro v1.2.2
     
  13. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Regarding the TextMesh Pro issue, I'll push an update to the Asset Store later today that should fix that issue. With 2018.1, I need to do some more testing. One issue that I have seen was that the old UnityGUI implementation seems to not work as reliably as it should. If you're using TextMesh Pro or UnityUI, this should not be a problem. I'll post an update later today.
     
    bjornrun likes this.
  14. bjornrun

    bjornrun

    Joined:
    Oct 29, 2013
    Posts:
    87
    I'm using without TextMesh Pro meanwhile and it works great with uGui.
    Now it is a matter of tweaking font size and everything will be perfect.
     
  15. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    That's great to hear! Yeah, uGui should work fine. It's only the old UnityGUI that we're having some trouble with (which may get deprecated at some point in time).
     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Ok, so ... ScoreFlash on Unity 2018.1 looks good so far. One important thing about TextMesh Pro and Unity 2018.1: TextMesh Pro now a package included with Unity, and this package is not compatible with the source-code version. If you get ScoreFlash for TextMesh Pro from the Unity Asset Store using Unity 2018.1 (after the update I'm uploading right now went through - so this will probably take about a week or so to actually land), you will have to use the version of TextMesh Pro from the Unity 2018 package manager.

    If you want to use ScoreFlash for TextMesh Pro with the source-code version of TextMesh Pro, I'd recommend getting it with Unity 2017.4 and then exporting / importing the package.
     
    bjornrun and hopeful like this.
  17. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    It looks like the update already went through - I'll be on a vacation for 10 days starting tomorrow (in fact, our flight starts less than 6 hours from now ... and I still hope to get an hour or two of sleep ;-) ) and just moved my office, so I hope all is well with that version.
     
  18. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    35
    I have a high movement game where things are moving around pretty fast, (think fast moving space ships in 3d space on all 3 axis's)

    The problem I am having with your addon for combat text is that the hit numbers when using Follow3D are jittering all over the place, I mean they are mostly staying with the unit like they are supposed to, but they are shaking like mad as they get larger and fade out. It's an extreme stutter! I can't find a way to fix it=/ Doesn't happen when my unit is still or cruising at a reasonable pace, but when I hit the boost and the unit starts hauling but the stuttering issues begin.

    Any idea what could be going wrong? The objects are moved along by the physics system using FixedUpdate
     
    jashan likes this.
  19. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    35
    PS it's a default setup although the Vanilla fonts will not work at all for me -- I had to change the font to something else, but other then that it's a simple setup, Scoreflash prefab on the scene with default configuration, scoreflash3dfollow script on the playerunits (also with default configuration), and using scoreflash.push and feeding it the 3d instance.

    I am wondering if it's because my units are moving so fast, when they are sitting still and not moving the text works fine, in fact sometimes when they are moving the text even works fine. Just seems like certain times when my object gets hit + is moving at a high velocity at the time of the hit, the stuttering gets crazy with the text. Where could I look at the code that makes the text follow the 3d object -- perhaps you could point me to it and I can see what is going on.
     
    jashan likes this.
  20. snair692

    snair692

    Joined:
    Feb 2, 2016
    Posts:
    35
    Fixed the issue, I moved all the code from "internal void update" in ScoreFlashFollow3dLocation.cs into the Fixedupdate that was already there.

    Now everything is fine. weird:)
     
    jashan and hopeful like this.
  21. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    Apologies for replying after you already fixed it - but I'm glad you were able to fix it. :)

    I should probably move everything to LateUpdate but I'm glad it's also working in FixedUpdate.

    Another thing that might improve the looks is to use world space text (there are examples using Unity UI in the examples folder). With the default implementation, the world position of the text is converted into a screen space position for rendering. When using world space text, the text is actually rendered where it is in the world.
     
    hopeful likes this.
  22. hworld

    hworld

    Joined:
    Mar 18, 2018
    Posts:
    4
    text don't display...

    I make a new scene, click 'GameObject/Create Other/Score Flash' button to add prefab to scene.
    Play the game, selected 'Testing/Autogenerate Messages', it's nothing.
    I show the debug info, I can see the box, but don't have text.

    QQ截图20180824225251.png

    I try some Xamples scenes, it works fine.
    I don't why, help me plz.
     
  23. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    One issue that I am aware of is that the old UnityGUI, which we still use as default, isn’t working as reliably as it should in current versions of Unity (2018.x). We do have examples where it does work (e.g. Plugins/NarayanaGames/ScoreFlash/Xamples-ScoreFlash/Xample_1_ColorsSequence) but for the 2018.x versions of ScoreFlash, I have also removed a few examples where it didn’t work.

    So maybe that’s what you ran into?

    What I would recommend is using Unity UI, which we also have quite a few examples for. When setting up a new scene, the most important part is selecting “Custom Renderer” under Main Layout in the ScoreFlash component, then assigning the UnityUI prefab (ScoreFlashRendererUnityUI), and assigning a Screenspace Overlay Canvas as parent.

    When you use the world space renderer prefab, you don’t need to assign a canvas because the canvas is part of the prefab in that case.

    Does that solve it for you?
     
  24. hworld

    hworld

    Joined:
    Mar 18, 2018
    Posts:
    4
    Maybe no.
    Is there any example scenes ?
    I do that like this, but didn't work.
    QQ图片20180825114820.png

    btw, I used Unity 2017.4.1f1, and I have 'Xample_1_ColorsSequence' scene, and it works fine

    Edit1:
    I think the problem is default script variables error (ScoreFlash Script).
    When I create prefab by 'GameObject/Create Other', it works bad.
    But I copy component from a correct one to a bad one , the bad one will works fine.
    I means, Unity 'Copy Component' and 'Paste Component Values' functions.

    I don't have power to find out which option is bad.

    Edit2:
    I find the key at 'ScoreFlash.cs, line: 2630', it's 'GUI.Label(localPos, msg.Text, msg.style);'
    I remove the 'msg.style' param, it will be ok, but lost style.
    I donot know how to fix it ....
     
    Last edited: Aug 26, 2018
    jashan likes this.
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    You mean for using Unity UI? Yes, of course :)

    ScoreFlashUnityUIExamples.PNG

    Actually, try it like this:

    ScoreFlashUnityUIExamples-WithConnections.PNG

    Actually, the idea is to use the ScoreFlash Prefab or a copy of that one (which you could add to the project by duplicating the prefab before pulling the prefab into your scene / hierarchy). That's this one:

    ScoreFlashPrefab.PNG


    Oh, that's an interesting finding. I'll look into that - thank you!
     
  26. hworld

    hworld

    Joined:
    Mar 18, 2018
    Posts:
    4
    Thank you for reply.

    I drag an exist scoreflash gameobject which in example scene to a new prefab.
    Then it works fine, and i export it , and import to my project.
    Now, it's ok.
     
    jashan likes this.
  27. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    152
    Does score flash support split screen? Dual cameras
     
  28. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,066
    It should under most circumstances. One potential problem would be if you use world space messages on objects that are visible in both cameras but from significantly different perspectives, and if those messages should point to the current camera (which is usually the case). You could solve even that case, but it might be a little tricky.