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. Dismiss Notice

2D TraileRenderer/LineRenderer to make a long laser beam that emits from a ship? (Video)

Discussion in '2D' started by batkinson, Jul 29, 2016.

  1. batkinson

    batkinson

    Joined:
    Mar 3, 2014
    Posts:
    17
    Video explaining what I've tried so far: https://vid.me/6iIT

    Hey guys, hoping someone can point me in the right direction here. I'm trying to make a long laser emit from my ship for a 2D game I'm working on, there's a reference to the look I'm trying to achieve in the video as well. Basically, I want to add a power up that's a really strong laser that emits outward from the ship, but as the ship moves, the base of the laser would be attached to the ship, so if you move back and forth, the laser would make an "S" shape as it continues to emit outward, but is coming from the front of the ship. Thanks!
     
  2. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
  3. batkinson

    batkinson

    Joined:
    Mar 3, 2014
    Posts:
    17
    Yes, as described in the video I've tried a TrailRenderer & LineRenderer, and I'm not sure that a particle system could achieve the effect that I'm looking for.
     
  4. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    So what is the problem or difficulty you're encountering? Or just looking for more ideas?

    A particle effect could work, you can set particles to emit based on distance traveled. IE - you move 10 units, you emit 100 particles, creating a trail.

    My apologies if you've described your issues in detail in the video, I'm currently without audio.
     
    Last edited: Jul 29, 2016
  5. batkinson

    batkinson

    Joined:
    Mar 3, 2014
    Posts:
    17
    Hmm, a Particle System actually may work upon further inspection, but it doesn't appear as if they work with 2D colliders.
     
  6. LiterallyJeff

    LiterallyJeff

    Joined:
    Jan 21, 2015
    Posts:
    2,802
    They should be able to:
     
  7. batkinson

    batkinson

    Joined:
    Mar 3, 2014
    Posts:
    17
    Ahh, I see it now, thanks!
     
    Last edited: Jul 29, 2016