A.Crane
A.Crane

Reputation: 435

LineRenderer Alignment Not Facing Vuforia ARCamera

I am trying to create a Line Renderer that renders a line between several objects augmented with Vuforia image targets.

I understand that the Line Renderer component has the "Alignment" field which can be set to either "View" or "Transform Z". For my project, I need the rendered lines to always face the camera, so I have that field set to View. Here is a picture of the component:

enter image description here

However, in both the Unity Editor preview and on my deployed Android application, the line rotates along with the objects (for example, if I move or rotate the image target). The ARCamera is already tagged as MainCamera, so it should be recognized as the camera.

Once I noticed this, to test if the field was being overwritten somehow, I added the line lr.alignment = LineAlignment.View; to both a start function at the beginning of the application, and to an update function, to make sure it is always set to View, but that did not change anything.

Is it possible for the Line Renderer to always face an ARCamera? Is there a step I am missing?

Here is a picture of the issue, where you can see that two of the lines are rotated to their side (the top line between the blue and green spheres is hardly visible). enter image description here

Upvotes: 2

Views: 367

Answers (0)

Related Questions