Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

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:
      956
    • 2.gif
      2.gif
      File size:
      267.2 KB
      Views:
      921
    • 3.gif
      3.gif
      File size:
      98.8 KB
      Views:
      949
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,570
    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:
    8,570
    kidapu_ likes this.