Search Unity

Trail Renderer always face camera

Discussion in 'Shaders' started by warit, May 25, 2008.

  1. warit

    warit

    Joined:
    Mar 4, 2008
    Posts:
    52
    I'm trying to attach trail renderer to hand held weapon, problem is, as seen in the picture below, particles always face camera instead of aligning to the rotation of the weapon -Making it looks "wrong".


    *edited: took picture out sorry company secret *


    Is there anyway we can change this?

    Thx.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's by design; usually when you have a trail, you always want to see it, so it has to rotate to face the camera to guarantee that. Otherwise it could kind of disappear when viewed edge-on.

    Except that's what you want in this case, so the built-in trail renderer isn't really going to be suitable. You might be able to get a similar result using particles, but if that's not good enough, then you'd need a custom trail renderer. Yoggy wrote a nice one which you can see here, and though that one still might not be suitable in this case, it could be used as a starting point.

    (Nice screenshot even with the problem.)

    --Eric
     
  3. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    There's also a "Tron Trail" in the Procedural Examples which can be found here. It is purely dependent on the transform of the object it is attached to and does not face the camera.

    Ethan
     
  4. warit

    warit

    Joined:
    Mar 4, 2008
    Posts:
    52
    Thanks, I'll take a look at Tron Trail tomorrow and let you know if it works.

    Anyhow, any chance that Unity support people will be nice enough to add this niffty option to the trail renderer in the next update?
     
  5. warit

    warit

    Joined:
    Mar 4, 2008
    Posts:
    52
    Okay, I have tried the mesh generation (Tron Trail) and it works.
    However, this makes things get really messy to go in and edit (not to mention slow things down when we want lots of them on screen at once.)
    Trail renderer seems to be more suitable for this purpose of making weapon trail.

    Any hope that Unity will be adding "not aligning to Camera" option to the Trail Renderer in the next version?