Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UnityEngine.Mesh.GetTriangleStrip(int)' is obsolete:

Discussion in 'Editor & General Support' started by Khyrid, Nov 24, 2012.

  1. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    SOLVED*** See bottom**
    I just installed 4.0 free and I get this yellow alert error:
    I'm not sure how to "Use GetTriangles".

    I also get:

    But I fixed that one.

    Solution:
    For "Mesh.SetTriangleStrip(int[], int)" change to "Mesh.SetTriangles(int[], int)"
    For "GameObject.active = true;" change to "GameObject.SetActive(true);"


    I tried that to begin with, but I suppose I typoed.
     
    Last edited: May 8, 2013
  2. Fab-London

    Fab-London

    Joined:
    Feb 6, 2013
    Posts:
    35
    I have the same issue, it will be nice to get an anser
     
  3. arcandio

    arcandio

    Joined:
    Aug 30, 2009
    Posts:
    89
    Same here. I tried fixing it but I just ended up breaking the whole deal both times.
     
  4. cmscluff

    cmscluff

    Joined:
    Apr 8, 2013
    Posts:
    1
    I've had the same problem here!

    I replaced with GameObject.SetActive(true); and received the error "An object reference is required to access non-static member `UnityEngine.GameObject.SetActive(bool)' "

    Then i replaced it with gameObject.SetActive (true); and now I am receiving no errors.



     
  5. Khyrid

    Khyrid

    Joined:
    Oct 8, 2010
    Posts:
    1,790
    Looks like I forgot to update this thread as solved, yet I still posted the solution that worked on my post.. weird.

    Anyway this is exactly what I use and no errors:

    targetGameObject.SetActive(true);
     
  6. ershin69

    ershin69

    Joined:
    Jul 3, 2013
    Posts:
    1
    How can this thread be solved?
    I'm having the same issue here and I don't know what do to.
    int curStripCount = combine.mesh.GetTriangleStrip(combine.subMeshIndex).Length;

    Edit: I just found the solution, use GetTriangles() instead.
     
  7. A_SHU

    A_SHU

    Joined:
    Dec 22, 2016
    Posts:
    1
    good!