Hello,
My created line renderer is visible in these cases:
- No play mode, game view, scene view.
- Play mode, game view, scene view.
However, is not visible when changing the position in script in either FixedUpdate or Update modes.
Laser Dot Script
private void Update()
{
if (laserDotActive) { FireLaserDot(); }
}
void FireLaserDot()
{
RaycastHit hit;
if (Physics.Raycast(laserStartTransform.position, laserStartTransform.forward, out hit))
{
// laserDot.transform.position = hit.point;
laserDotLR.SetPosition(0, hit.point);
laserDotLR.SetPosition(1, hit.point);
}
}
If I select the line renderer game object in the hierarchy, its position IS updated accordingly. This I can see thanks to the object gizmos in scene view, and Element 0 and Element 1 changing in the inspector.
However, the line renderer itself is not visible anymore. The line renderer’s both points are set to the same location because I am trying to create a laser dot.
Also, I am using the default particle as the material and color is set to red (1,0,0). Width is 1, using world space, no loop.
Using SteamVR, Unity version 2017.3.0f3.
Thanks!