Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Trail Renderer Edge Issues

Discussion in 'General Graphics' started by Kirbychwan, Sep 11, 2018.

  1. Kirbychwan

    Kirbychwan

    Joined:
    Aug 14, 2012
    Posts:
    430
    So I wanted to create a 2D blade with a simple trail renderer that follows the edge of the sword. I figured it'd be fairly easy, since it's pretty much one of the most typical uses of a trail renderer.

    Alright, so far so good. I move the sword up and down, and it does its thing, mostly.

    upload_2018-9-10_17-8-54.png


    However, it soon became clear to me that it was seemingly impossible to sort of 'parent' the trail renderer
    to the edge of the blade, since the trail renderer rotates like crazy in whatever direction it wants to go in.

    upload_2018-9-10_17-9-51.png

    How the heck do I keep the trail renderer oriented to the edge of the blade, and not just spin like crazy and create ugly sharp lines?

    Another bit of weirdness is that the trail renderer texture FLIPS if I am moving down as opposed to up, which feels like a bug to me.

    upload_2018-9-10_17-12-57.png


    tl;dr: I thought a local space trail renderer that I can kept oriented to the edge of a blade would be easy out of the box; it seems like it's not even an option? Is there a method to achieving this that I'm not seeing?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    10,228
    Try setting the alignment to Local.
     
  3. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    1,744
    I don’t think this is possible with the trail renderer. It only uses positions to build its trail, it ignores transform rotation.
     
    karl_jones and bgolus like this.
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    10,228
    And this is unfortunately why Ive always rolled my own trail renderer. Lately Ive been using Ara Trails which is pretty close to what I had going with my previous employment. Though it's still missing my #1 missing trail feature: spawn stable world distance tiled UVs.
     
unityunity