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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

LineRenderer stays after it should disappear

Discussion in 'Scripting' started by spencer_white, Dec 9, 2015.

  1. spencer_white

    spencer_white

    Joined:
    Nov 9, 2015
    Posts:
    37
    I have a linerenderer, which is turned on by the click of the mouse. When I release the mouse button, the 'laser' stays in the same position until I click again. Can someone help?
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    how are we going to help if you don't show use how you've implemented your code??
     
  3. Strategos

    Strategos

    Joined:
    Aug 24, 2012
    Posts:
    255
    Line renderers will stay, why not set lineRender.enabled to be false after you have released the mouse.