Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. The 2023.1 beta is now available for testing. To find out what's new, have a look at our 2023.1 feature highlights.
    Dismiss Notice

LineRenderer animates something strange in Unity 5.5.0b2

Discussion in '5.5 Beta' started by kidapu_, Sep 15, 2016.

  1. kidapu_

    kidapu_

    Joined:
    Jun 26, 2015
    Posts:
    2
    I executed below code for checking LineRenderer behavior in Unity 5.5.0b2.


    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Rendering;
    3.  
    4. public class MainController : MonoBehaviour
    5. {
    6.     private LineRenderer _line;
    7.  
    8.     void Start ()
    9.     {
    10.         _line = gameObject.AddComponent<LineRenderer>();
    11.  
    12.         _line.shadowCastingMode = ShadowCastingMode.Off;
    13.         _line.receiveShadows = false;
    14.  
    15.         var mat = new Material(Shader.Find("VR/SpatialMapping/Wireframe"));
    16.         _line.sharedMaterial = mat;
    17.  
    18.         float width = 0.5f;
    19.         _line.startWidth = width;
    20.         _line.endWidth = width;
    21.         _line.SetVertexCount(3);
    22.  
    23.         _line.numCapVertices = 0;
    24.         _line.numCornerVertices = 0;
    25.     }
    26.    
    27.     void Update ()
    28.     {
    29.         // Loop1();
    30.         // Loop2();
    31.         Loop3();
    32.     }
    33.  
    34.     void Loop1()
    35.     {
    36.         float v = Mathf.Sin(Time.time);
    37.         _line.SetPosition(0, new Vector3(-1, 0, 0));
    38.         _line.SetPosition(1, new Vector3(0, v, 0));
    39.         _line.SetPosition(2, new Vector3(1, 0, 0));
    40.     }
    41.  
    42.     void Loop2()
    43.     {
    44.         float v = Mathf.Sin(Time.time);
    45.         _line.SetPosition(0, new Vector3(-1 + v, -1, 0));
    46.         _line.SetPosition(1, new Vector3(0, 1, 0));
    47.         _line.SetPosition(2, new Vector3(1 - v, -1, 0));
    48.     }
    49.  
    50.     void Loop3()
    51.     {
    52.         float v = Mathf.Sin(Time.time);
    53.         _line.SetPosition(0, new Vector3(-1 , -1, 0));
    54.         _line.SetPosition(1, new Vector3(0, 1, 0));
    55.         _line.SetPosition(2, new Vector3(1 - v*2.5f, -1, 0));
    56.     }
    57. }

    In the case of Loop1(), the result is attached `1.gif`.
    Center corner moves jerkily.

    In the case of Loop2(), the result is attached `2.gif`.
    Though the center point is fixed in code, but it moving. I think it should not move.

    In the case of Loop3(), the result is attached `3.gif`.
    Right arm transforms from rectangle to triangle suddenly. I think it should not transform triangle.
     

    Attached Files:

    • 1.gif
      1.gif
      File size:
      1.9 MB
      Views:
      850
    • 2.gif
      2.gif
      File size:
      267.2 KB
      Views:
      814
    • 3.gif
      3.gif
      File size:
      98.8 KB
      Views:
      838
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,049
    Hey.
    Could you please file a bug report with the attached information so we can look into it? Post the number here so I can track it.
    Thanks
     
    richardkettlewell likes this.
  3. kidapu_

    kidapu_

    Joined:
    Jun 26, 2015
    Posts:
    2
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,049
    kidapu_ likes this.