LineRenderer does not work on mobile devices(Please me)

Hello , sorry for my English:)

This script works great in Editor,but does not workon mobile devices
Use 2D

using UnityEngine;
using System.Collections;
using System.Collections.Generic;


public class Line : MonoBehaviour {
    public bool Dynamic;

    public float Size = 1f;
    public Material _mater;
    [System.Serializable]
    public class LineSettings{
        public Vector3 StartPosition;
        public Vector3 EndPosition;

        public Transform StartTargetPosition;
        public Transform EndTargetPosition;

        public LineRenderer LR;

    }    public List<LineSettings> lineSettings;

    public Color colorLineStart = Color.blue;
    public Color colorLineEnd = Color.green;
    public LayerMask Layer;
    public int OrderInLayer;


    private Transform _thisTransform;


    void Awake(){
        _thisTransform = transform;
    }


    void Update(){
        if (Dynamic ) {

        if ( lineSettings != null ){

            for ( int i = 0; i < lineSettings.Count; i++){
         
                    lineSettings[i].LR.SetPosition(0,lineSettings[i].StartTargetPosition.position);
                    lineSettings[i].LR.SetPosition(1,lineSettings[i].EndTargetPosition.position);
         
              }

           }
        }

    }


    public    void AddLine(Transform _start,Transform _end){

          LineSettings NL = new LineSettings();
            GameObject NewLine = new GameObject("MyLine",typeof(LineRenderer));
               NewLine.transform.SetParent(_thisTransform);
                 NewLine.layer = 11;

         NL.StartPosition = _start.position;
          NL.EndPosition =  _end.position;
           NL.StartTargetPosition = _start;
             NL.EndTargetPosition =  _end;

         NL.LR = NewLine.GetComponent<LineRenderer>();
         NL.LR.sortingLayerName = "Girl";
         NL.LR.sortingOrder = OrderInLayer;
         NL.LR.material = _mater;
         NL.LR.SetColors(colorLineStart,colorLineEnd);
         NL.LR.useLightProbes = false;
         NL.LR.receiveShadows = false;
         NL.LR.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
         NL.LR.SetWidth(Size,Size);
         NL.LR.SetVertexCount(2);

        if (!Dynamic){
          NL.LR.SetPosition(0,  NL.StartPosition);
           NL.LR.SetPosition(1,  NL.EndPosition);
        }

            lineSettings.Add(NL);
    }

public void DeleteLine(int number){
        Destroy(_thisTransform.GetChild(number).gameObject);
        lineSettings.RemoveAt(number);
 
    }

public void ClearLine(){
        for ( int i = 0; i< _thisTransform.childCount; i ++ ) {
            Destroy(_thisTransform.GetChild(i).gameObject);
        }
        lineSettings.Clear();
    }
    //                    lineSettings[i].LR.SetPosition(0,new Vector3(lineSettings[i].StartTargetPosition.position.x,lineSettings[i].StartTargetPosition.position.y,0));
    //                    lineSettings[i].LR.SetPosition(1,new Vector3(lineSettings[i].EndTargetPosition.position.x,lineSettings[i].EndTargetPosition.position.y,0));
}

Don’t have any guesses why

My actions to correct the problem:

1.Change the z coordinate of -100 to 100
2.Tried to use different shaders
3. in the Edit menu/Graphics Add shaders to"Always included shaders"

Nothing helps, works in the editor,but not on the device,help please

Thanks for the help

Line renderer most definitely does work on mobile devices. I used it in a game I published recently on Google play called ’ Two Lines’. I’m not sure why yours is not working…just keep at it I suppose. Good luck

Hi Denis,

I failed to see any reason your line renderer is not working. Since this is not really a 2D related issue, I suggest you narrow down the problem to which particular device that is not working and move this post to the related platform forum. You might can better help from there.

Hello

I found the problem,as usual it myself:)
“Tutorial how to make 100 wrong action and ignore one important”

I have called the function AddLine in #UNITYEDITOR
And forgot her record in #UNITYANDROID

Fail
Very sorry,but thanks anyway)