Forum rules - please read before posting.

Error with hotspot (look at) on complex mesh

edited July 2019 in Technical Q&A

I have an FBX model of a room with many objects. All imported to Unity. This is my test scene. On two separate models I have placed a Hotspot and used the Look at to have player say something (text). This is when I get the following error.

ArgumentException: Mesh can not have more than 65000 vertices
UnityEngine.UI.VertexHelper.FillMesh (UnityEngine.Mesh mesh) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Utility/VertexHelper.cs:206)
UnityEngine.UI.Graphic.DoMeshGeneration () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:633)
UnityEngine.UI.Graphic.UpdateGeometry () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:614)
UnityEngine.UI.Text.UpdateGeometry () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Text.cs:573)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:572)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:198)

All other hotspots on the rest of the models of the scene work as they should. I am not sure how the Hotspot is related with the 65000 vertices and these two particular meshes. These meshes (in red) are also very light as all models of the scene are optimized. Any ideas why is this happening ?


  • Exactly when does the error show? The message is not AC related, but is a rendering warning from Unity.

    Unless another sub-mesh in your FBX file has 65000 vertices, it may be that Unity is counting all in the same FBX file together. I would recommend breaking it up into separate mesh files - but either way, this is a Unity rendering issue.

  • The error shows exactly at the moment when i click on the look at icon and then the player must say something about what he sees on a monitor. It is pretty simple and easy. I don't understand why it does that on specific model while of course it works on all others. The total polycount is 272 K and 141k vertex count of the scene is there a relation of hotspot with the rendering of the mesh ?

  • A model is not necessary for the Hotspot to function - only a collider. Are you using a Box Collider or Mesh Collider? As a test, use a Box Collider and disable the Mesh Renderer - that way, you can be sure it's referring specifically to that Hotspot.

    The only way a Hotspot itself is affected automatically when interacting with it is that the Highlight component will kick in to brighten/darken whatever you've assigned it to. Are you using such a component, and if so - on what?

    272k and 141k being what - the object and the scene respectively? If a single mesh is exceeding Unity's limit of 65k then you will need to break your mesh up. It's also possible that this is a Unity bug - what's your version?

  • 272K poly is the whole scene and 141K are the vertices of the scene which consists of many models.

    I am using Unity ver 2019.1.6f1.

    I am using a mesh collider if you are talking about the models. The hotspot by default is using a box collider.

    I am using highlight script on the monitor mesh and on the paper box mesh too.

    I did the trick with the box collider and the mesh renderer and the error remains.

  • One thing I have to contribute is this. In one of the two cases or errors I am getting. I have a large dialogue. The error comes up before the dialogue finishes right in the middle of a word.

  • edited July 2019

    Does the error persist if you unset the Hotspot's "Highlight" component?

    Whether this appears as a result of interacting with a Hotspot or not, the warning is still valid. It's coming from Unity, and not for any reason that's AC-related. Again, you should look into splitting up the scene model, as I suspect Unity is counting them all together.

  • @ChrisIceBox it gives the same error even if i unset the highlight component. It seems like i need to follow your advice and reproduce the scene not as one big FBX. Ok let's pick this up when i have that scene ready. Thank you for the help (as I have other matters that i will be needing your help :) )

  • edited July 2019

    @ChrisIceBox ok I imported the models in small teams that have the same texture and are surely less than 65000 verts (total is 11000) the problem persists. If I make the description dialogue less in length then it doesn't crash with the error.

  • edited July 2019

    I have found this though which I think has to do with the problem!

    Text consumes 8 vertices with one character, which amounts to about 20 times that of OutLine.
    In other words, it consumes about 150 vertices with one character.
    Because the vertex needs to be 65000 or less. 65000/1500 = 433.
    Within one page, 433 characters is the upper limit.
    This problem is because the number of vertices is 10 times or more for OutLine.
    You can reduce the number of vertices by reducing the number of CopyCounts of the RichOutline component.
    RichOutline makes the text outline look beautiful. It is Rich as it has a high vertex load.

    I use outline for the text in dialogues. Because the outline in UI is thin I have used 3 outlines so according to the above outline is 150 times x 3 on each character so it passes the 65K if the dialogue is big enough. This is the solution . Use no outline or less outlines.

    Now someone needs to tell me how to make characters with a thick outline without causing this :)

  • You can look into using Text Mesh Pro, which offers outlines. If your Menus rely on Unity UI, you can switch over completely to Text Mesh Pro by adding the TextMeshProIsPresent scripting define symbol, which will cause AC to refer to the TextMeshProUGUI component instead of Unity's own Text component.

    For more, see the Manual's "Supported third-party assets" chapter.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.