Search Unity

Question Force Increase Maximum Character Limit For Input Fields

Discussion in 'Scripting' started by DotArt, Mar 9, 2023.

  1. DotArt

    DotArt

    Joined:
    Jun 12, 2021
    Posts:
    82
    Hey, so i know that setting the Maximum Character Limit to 0 will mean that there isn't any character limit, and this is fine for in the editor, if i paste my save key which is around 40,000 character's, theres alot to save ahah, then it pastes all of it in and if i copy it from the input field and paste it back into the text document then its all there.

    The problem comes with when i build it for the Web which is why i need it so saves can be transferred between updates. For web builds when it generates the save key it forces it into the input field fine and gives you everything you need (Around 40k Character's). When you try and paste the save key back into the input field it gets limited at 16,000 characters and it wont let you paste anymore. You can force break this by having two inout fields and pasting half in one half in the other and then force adding them together within a script but this isnt a very good way of doing it, im wondering if theres a way to force allow the character limit to be higher so it can all be pasted into one.

    Or maybe even not need an input field and instead make a string = to whats in the persons clipboard
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,751
    This 16000 char limit is likely 16384 (or 16383) characters, since the 16-bit mesh is limited to 64k (65535) vertices and each glyph is 4 verts.

    Meshes CAN be toggled to be 32-bit, which gives you effectively either 2 or 4 billion verts.

    This is the property that controls it:

    https://docs.unity3d.com/ScriptReference/Mesh-indexFormat.html

    I don't have TMPro handy but the source is there, and it might be possible to specify 32-bit meshes, or else for you to hack into it to make that happen.
     
    Bunny83 likes this.