So I have seen quite a few issues with LineRenderer but none of them answer my issue and I have been unable to find a source in the forums, manuals, or script examples. So my issue is:
- Using LineRenderer for the red sight of a gun in a 2D shooter
- Red sight goes from gun (its parent object) to mouse pointer using CameraToWorldPoint
- Looking through scene view the beam is always there, but in game view it slims down to nothing based on the position.
The code is simple in my head but it doesn’t want to work correctly. Anyone know what causes this or need more information for what I messed up?
mouse_pos = Camera.main.ScreenToWorldPoint(Input.mousePosition); snipeTrail.SetPosition(0, transform.position); snipeTrail.SetPosition(1, Camera.main.ScreenToWorldPoint(Input.mousePosition));
Adding an image to show this, scene view different than game view: !