Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whitespace error in UITextSplineController
#1
Hi,
I'm using UITextSplineController to make Text follow a spline, but I get an error when I type a Whitespace character.
Is it possible to use Whitespace characters? Is there a solution?

Code:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
FluffyUnderware.Curvy.Controllers.UITextSplineController+GlyphQuad.LoadTris (System.Collections.Generic.List`1[T] verts, System.Int32 index) (at Assets/Curvy/Plugins/Curvy/Controllers/UITextSplineController.cs:56)
FluffyUnderware.Curvy.Controllers.UITextSplineController.ModifyMesh (UnityEngine.UI.VertexHelper vertexHelper) (at Assets/Curvy/Plugins/Curvy/Controllers/UITextSplineController.cs:252)
UnityEngine.UI.Graphic.DoMeshGeneration () (at /Applications/Unity/Hub/Editor/2020.3.7f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Graphic.cs:675)
UnityEngine.UI.Graphic.UpdateGeometry () (at /Applications/Unity/Hub/Editor/2020.3.7f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Graphic.cs:660)
UnityEngine.UI.Text.UpdateGeometry () (at /Applications/Unity/Hub/Editor/2020.3.7f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Text.cs:572)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at /Applications/Unity/Hub/Editor/2020.3.7f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Graphic.cs:618)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Applications/Unity/Hub/Editor/2020.3.7f1/Unity.app/Contents/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:217)
UnityEngine.Canvas:SendWillRenderCanvases() (at /Users/bokken/buildslave/unity/build/Modules/UI/ScriptBindings/UICanvas.bindings.cs:83)
Reply
#2
Hi
It was possible at some point, maybe there were regressions with later Unity versions. Let me check that and will come back to you soon.
Until then, have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Hi again

Here is the fix: go to Curvy\Controllers\UITextSplineController.cs, then to the following method:

public void ModifyMesh(VertexHelper vertexHelper)

find the for loop in it, and replace it with the following:

Code:
int readingIndex = 0;
for (int letterIndex = 0; letterIndex < Text.text.Length; letterIndex++)
{
  if (Text.text[letterIndex] == ' ')
    continue;

  glyph.LoadTris(verts, readingIndex * 6);
  readingIndex++;
  UpdateGlyph(glyph);
  glyph.Save(vertexHelper);
}

Please let me know if this didn't fix the issue.

If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#4
Thank you for your quick response. I can now enter Whitespaces!! Big Grin
Reply
#5
What a wonderful world! Big Grin
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error while making prefab having curvy Generator script User2200 3 663 03-15-2021, 07:16 PM
Last Post: _Aka_
Bug Got Position { Nan } error. Canis 3 1,307 08-20-2020, 06:27 PM
Last Post: _Aka_
  Error: Calling TeleportBy on a controller that is stopped jamesunity 5 1,985 07-13-2020, 12:28 PM
Last Post: _Aka_
  Playmaker error Lupp_ 7 3,783 01-08-2020, 12:49 PM
Last Post: _Aka_

Forum Jump: