Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Better Trails - Unity3D Trail Replacement (Trails, smoke plumes, skid marks, etc!)

Discussion in 'Assets and Asset Store' started by Pigeon Coop, Mar 19, 2014.

  1. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    With particle systems you are able to control how they layer with sprites by modifying renderer.sortingLayerName and renderer.sortingOrder. Will this also work with your trails?
     
  2. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Ah I was not aware of the sorting order for particle systems! No, that wont work with better trails as there is no actual 'renderer' and the function I use to render trails does not support sorting order! You might be able to play around with the "Queue" tag of your trail materials shader and fudge some sorting that way? I am not sure unfortunately and that is not the most practical workaround. I'll keep digging for a way to fix it, but I feel like it is out of my hands until Unity allows me to specify SortingOrder with Graphics.DrawMesh. So yes, for now you can't specify sorting orders with Better Trails + Sprites, which can and will result in incorrect sorting.
     
  3. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    Yes I feel like Unity really dropped the ball with this. Did they expect everyone to make games with sprites exclusively? Maybe some of this will get implemented with 4.6
     
    Pigeon Coop likes this.
  4. abhimir

    abhimir

    Joined:
    Jul 25, 2012
    Posts:
    1
    I just bought this asset. I had a couple of questions, is there an email that I can use to reach you?

    Apart from that, currently I am just interested in integrating the either Trails / Smooth Trails into my project, so can I just copy these 2 scripts into my existing project and expect it to work, or are there other things that I need to import too.
     
  5. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Our email is contactpigeoncoop[at]gmail.com, you can fins publisher contact details on the asset store publisher pages! :)

    You can safetly delete the Examples folder and the Shared sample assets folder.
     
    Last edited: Jul 28, 2014
  6. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I went to buy Better Trails, but it lists Unity 4.5.0 as a requirement and the buy button doesn't light up. Is that really a requirement? I need to stick with 4.3 for now.
     
  7. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    There are some errors in 4.3 - I am using some functionality that is new to 4.5 but the errors are only in my custom inspector scripts (so none of the actual functionality is broken). I can send you a "4.3 version" if you can send me your invoice number. I'll apply my custom inspector fix and republish the asset with unity 4.3 ASAP, so you might want to just wait until then?
     
  8. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    My main question was just how to purchase it at all, since the buy button doesn't show up in the Asset Store window in Unity at the moment, because of the 4.5 thing. Then it dawned on me that I could just buy it from the web site, so I just did that. No rush, I can wait for the republish. So far the examples work, except for the SmoothTrailScene example (sword on left has no trail), so it should be good enough to start playing with it.

    Thanks!
     
  9. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Strange, I would love to know why that is the case! I'll have to make sure that I saved the scene properly when I published the asset, thanks for pointing that out!
     
  10. jasonoda

    jasonoda

    Joined:
    Sep 7, 2012
    Posts:
    67
    Hey Pigeon Coop,

    Question: I notice when the frame rate goes down a bit, the trails on my sword swish (which are very fast) start to appear to be angular rather than a smooth circle. Are there any tricks to prevent this? or do I have to use something else?
     
  11. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey Jasonoda!

    There isn't too much I can do about that unfortunately. :( The trail will look worse the more your frame rate fluctuates. I have no solution for that right now. Have you tried using the smooth trail renderer instead?
     
  12. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Is it possible to use BetterTrails with an older Unity Version? I want it to get to work with the Unity Playstation Mobile (PSM) in order to play(test) the game on the PS Vita and the special Unity Build for PSM is Version 4.3.4f1, but apparently I can't add no script to an object, it says the Scriptnames don't match.
     
  13. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey BTStone, I'll have a look into this problem when I get home tonight and squish this bug once and for all! I wanted to look at it earlier but I moved houses so I didn't have proper internet access. My connection is live now and I can download 4.3.4f1 for myself and try it out. Will report back with an answer ! There should be no issues using Better Trails with 4.3.4f1, except for this bug thats preventing users from attaching the script..
     
    BTStone likes this.
  14. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    @BTStone I can't replicate this issue myself.. How strange. (4.3.4f1). All my example scenes work fine and I've got no compiler errors. Can you try deleting and reimporting the package, as well as deleting the example folder (__Effects (Trails) Examples) and seeing if it compiles successfully then?

    Also are you able to post the error here exactly?

    Thanks Btstone!
     
  15. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    It's not an ErrorLog per se but a little Unity Popup Window which appears when I want to add the script.
    But I'll test it again and will post the result!
     
  16. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    How strange :S I just tried it on mine and it works fine. Thanks for testing! I would really love to get this fixed so others dont have the same issue
     
  17. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I'm getting errors in some of the example scenes. Can you check that?
     
  18. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey man. I am not getting any errors myself. Could you post the errors here along with your unity version and which example scenes produce the error? Something funny is definitely going on here... I think I might have a solution. Can you two try this please? And see if it fixes the issues? If it does then it night have something to do with me using some C# 4 features somewhere.

     
  19. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    4.3.3, SmoothTrail sample scenes have error. I'm not touching monodevelop.
     
  20. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Could you post the error here?
     
  21. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey guys (Namely @imtrobin and @BTStone ) I think I have a solution to the problem :) But ofcourse I can't test it on my end. I am 99% certain the issue could be resolved by setting your target framework to 4.0 (as in the image above) but I wasn't sure what I was causing this requirement. Turns out I have a 'default parameter' in one of my functions. Easy to fix!

    Find this line in SmoothTrail.cs
    Code (CSharp):
    1. public Vector3 GetPointAlongCurve(Vector3 curveStart, Vector3 curveStartHandle, Vector3 curveEnd, Vector3 curveEndHandle, float t, float crease = 1)
    Replace with this

    Code (CSharp):
    1. public Vector3 GetPointAlongCurve(Vector3 curveStart, Vector3 curveStartHandle, Vector3 curveEnd, Vector3 curveEndHandle, float t, float crease)
    Enjoy
     
  22. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    fixed, thanks.
     
  23. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I found that the smooth trail is not able to follow the object (a flying plane in my case ) at high speed. Plane is traveling at 250m/s.
     
  24. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hmm I haven't tried Better Trails with such extreme speeds. I'll have a look tonight and report back to here if I can work something out mate :)

    Glad its working for you now! I can cross that off my list
     
  25. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    @imtrobin Hey mate

    Send me your invoice number in an email and I'll send you an updated version of Better Trails that fixes your issue with the smooth trails. :) Our email is contactpigeoncoop [at] gmail [dot] com. I won't be submitting this fix to the asset store just yet, I still have some tasks on my to-do list for Better Trails
     
  26. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Sorry, but I could test it not until today. It was the line of code which did the job. The change of the TargetFramework wasn't necessary :)

    Thanks! :)

    Edit:

    Would be great if you'd update this in the next BetterTrails Version :)
     
  27. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    @BTStone Yep, this is included in the next version, as well as a fix to make the trails 'snap' properly to the root transform! See here:


    Keep an eye on this thread, I'll let you all know when I submit the update. I am just crossing a few other small things off my todo list before I submit :) edit: so if you have any minor feature requests, now is the time to tell me!
     
  28. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Sent
     
  29. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey imtrobin, I've send you an email with the update attached :)

    Another new feature I am working on is a 'simple mode' for the color/size over lifetimes. Some users wanted an ability to simply define the start and end size/color values without having to play around with the curve or gradient editor. Here is sort of what it looks like right now, though I may still shuffle some elements around in the inspector to make it easier to read.

     
  30. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    The patch u sent, TrailRenderer_base is using UnityEditor reference. Need to remove to build
     
  31. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Oh whoops. I'll fix that when I get home. Thanks man.

    I have been shuffling around a lot of stuff for better trails (moving codebase over to GIT, etc). These are just growing pains :)
     
  32. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    I had to resubmit my update to the asset store to fix the bug imtrobin pointed out, hopefully it'll be live next week! Coming features include the 'simple' input mode (toggled via to context menu of the inspector), a fix for the trails to make them 'snap' to the parent properly and some 'experimental' code for "pausing" the trails (without using Timescale). The code for the pausing works fine from what I've tested, but I won't announce it as a feature until I've tested it more. It is in there and you can access it by calling a method on the TrailRenderer_base - more info on this when the asset hits the store! :)
     
  33. Lex-DRL

    Lex-DRL

    Joined:
    Oct 10, 2011
    Posts:
    139
    We've recently purchased this plugin. And now, when I finally get into the effect we purchased it for, I'm facing a bug that makes Better Trails completely unuseable for our purposes.
    In short, Better Trails render wrong with "Use Forward Override" UNchecked (i.e., default "face to camera" behavior).
    To illustrate this issue, here are some videos.

    This is how default Unity's "trail renderer" looks (works as it should):


    And this is how "Better trails" work (applied to the same objects):



    As you can see, for some reason Better Trails flip their orientation during time. In the one frame, the normal of a newly created polygon faces to the camera. In the next frame, it faces outwards. Causing trails to swing from left to right as if they were a flag, not camera-oriented trail.

    The issue appears with different trail types (I tested it with simple "Trail" and "Smoke plume"). Unity 4.5.0f6

    If you're interested, I'm trying to achieve a smoke effect similar to what you've seen in the recent PS4 blockbuster "Infamous: Second Son". Here in the fourth video (screenshot) you can see that it's accomplished using trails, in which each and every segment tries to face the camera as much as possible.
     
    Last edited: Aug 27, 2014
  34. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey man sorry you are having issues with it..! Those videos are really helpful, thanks so much! I'll start looking into this and see what I can sort out. Send us an email at contactpigeoncoop [at] gmail [dot] com so I can keep you posted on this as I work to fix it :)

    PS awesome looking game !
     
  35. Lex-DRL

    Lex-DRL

    Joined:
    Oct 10, 2011
    Posts:
    139
    Thank you for fast response. Email sent.
     
  36. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Hey ya'll! A new version has hit the shelves, no major features but some nice little ones this time! :)


    Change log 1.4.6
    • Made the trails attach to their spawner correctly
    • Added a 'simple' color/size input method to do inspector
    • Updated docs
    • Fixed a bug where we were including the UnityEditor namespace in an ingame script :oops:
    Many users asked for a way to enter float values for the size and a simple color picker for the trail color! This is super useful when you just want to play around with Better Trails and get a quick 'feel' for the effect you are trying to achieve :)
     
    Last edited: Sep 14, 2014
  37. willtrax

    willtrax

    Joined:
    Feb 9, 2013
    Posts:
    14
    I just purchased this asset today looking to find something with more flexibility than the built in trail renderer. After incorporating Better Trails the results look very good and I get the functionality I need, but the performance as indicated in the profiler is disappointing.

    Using five smooth trails of I get surprisingly heavy CPU usage through both the Smooth Trails and Trail Base scripts (1.22ms total on desktop). Also these put out a combined ~1k towards garbage collection each frame.

    Could there be performance enhancements I'm overlooking or is this pretty standard? thanks
     
  38. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    How many control points and how many inbetween points have you specified for the smooth trails?
     
  39. Andy-Lee

    Andy-Lee

    Joined:
    Aug 16, 2014
    Posts:
    26
    I am quite interested in this asset. The built-in trail renderers are really killing framerates in our mobile game.
    One thing I want to confirm is: are the properties accessible via script?:D
     
  40. Pigeon Coop

    Pigeon Coop

    Joined:
    Jan 17, 2014
    Posts:
    186
    Yes ofcourse :) Thought I will say that the individual properties are not commented. Its accessibly but there is no documentation once you step outside of the stuff mentioned in our pdf document. (Though it is relatively easy to work it out!)
     
  41. Andy-Lee

    Andy-Lee

    Joined:
    Aug 16, 2014
    Posts:
    26
    Thanks. If your property names are not too different from what they do then we will be fine. :D

    Oh, another two questions suddenly came to my mind:
    - how about getting the points of the trails? It would be great for making collision detection alone the trail. :rolleyes:
    - we want to apply pooling on the trails or the objects that own the trails. Do we need to pay attention to anything? Kill the trails before reusing them?

    Edit:
    - one more not-so-important question / request: in your examples, the textures are evenly stretched along the trails, just like the built-in Trail Renderer. Is there anyway that can let the two ends of the trail get more percentage of the texture? It is like 3-slice scaling.
     
    Last edited: Sep 18, 2014
  42. willtrax

    willtrax

    Joined:
    Feb 9, 2013
    Posts:
    14
    Thank you for the reply. I was using a maximum of 50 control points and 4 points between.

    I am including an image of the profiler taken while running one of the demos included in the better trails asset which demonstrates similar performance. The profiler appears to show 1ms in combined cpu time for the trails and roughly 1K gc allocated each frame.



     
  43. kjuanlu

    kjuanlu

    Joined:
    Dec 4, 2011
    Posts:
    100
    Hello Pigeon Coop

    I just bought better trails, it looks great ;)

    I´m trying to use it with javascript, but I can´t call c# scripts until they are inside Standars Assets, Plugins or Editor. I tried to move the folder to StandarAssets, but then your Editor scripts does not work. Do you have any suggestion?

    I can also create a c# script in StandarAssets to make as a bridge between my javascript code and your tool, but I prefer to interact directly into js code.

    Regards
     
  44. kjuanlu

    kjuanlu

    Joined:
    Dec 4, 2011
    Posts:
    100
    Solved, I moved the editor Scripts to Editor folder, and the other Scripts to StandarAssets :)
     
  45. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    I purchased this last night.

    A couple of observations:

    1) I don't see a way this supports the typical pooling use case where you stop an emitter and wait for it to complete. In order to do this, I had to expose "_fadingTrails" publically through a getter on the trail renderer so I could poll it for completion. I also hacked CheckEmitChange to be public so I could change the emission (to false) and the call this method to force the logic to run that detaches the fading trail immediately (there were alternatives to doing this, like exposing activetrail, and polling that in addition to fading trails).

    2) It looks like you detach the trail from the emitter once you stop emitting, presumably so you can start a new trail when the emitter is marked as "emit" again. However, once the "fading" trail is done, you call Dispose on it and destroy the underlying mesh. Why wouldn't you just repool those, since any trail requiring that number of points (or less) could reuse that mesh, or at least make that an option? If this was an option, users could choose a set of trail sizes and stick to those, to ensure the number of pooled trails didn't bloom out of control (due to the different number of points). Even instances of PCTrailPoint should be pooled, as there is no reason to dynamically allocate those.

    3) What is the Reset method for in TrailRenderer_Base - it is protected, and only called by the overridden implementations of it. It doesn't appear to ever be used (unless you hit it with reflection somewhere).

    4) It appears as if the first point in the trail is dropped at MinVertexDistance in the component Trail is not where the trail was spawned but rather after MinVertexDistance. If you set the distance to something large, the first trail point won't be dropped until that distance is reached, which doesn't make sense. Shouldn't it always drop a point when it is spawned?
     
  46. Andy-Lee

    Andy-Lee

    Joined:
    Aug 16, 2014
    Posts:
    26
    It seems that the developers are very busy. I have sent an email to them weeks ago but still no reply. :confused:
     
  47. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    I'm running into an issue when meshes are combined in TrailRenderer_Base.LateUpdate when a Trail gameObject has been destroyed but _matToTrailList still has a reference to its trail and mesh.

    In the Unity Editor console, I get a warning from Unity's CombineMeshes():

    Code (CSharp):
    1.  
    2. Combine mesh instance 0 is null.
    3.     Stack Trace:
    4.     UnityEngine.Mesh.CombineMeshes()
    5.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    6.  
    My understanding of this is as follows:
    1. _matToTrailList is used to batch trails and their meshes by material. It is a static dictionary shared by all TrailRenderer_Base instances.
    2. Every instance of TrailRenderer_Base adds its meshes to _matToTrailList in its Update, based on its material.
    3. The 1st instance of TrailRenderer_Base that runs its LateUpdate will do the CombineMeshes and clear _matToTrailList so that subsequent TrailRenderer_Base instances won't need to do this. This combined mesh is queued to be cleaned in the next frame.
    4. In the next frame, all meshes marked to be cleaned are destroyed (by the 1st instance of TrailRenderer_Base that runs its Update) and the whole process repeats from #2.
    I have 2 instances of Torpedo gameObjects, both with the Trail components using the same material. Here, they add their trail meshes to _matToTrailList in their Update.

    Code (CSharp):
    1.  
    2. Log (22:31:31.2683)
    3. Torpedo0 (UnityEngine.Transform).Update: Adding activeTrail mesh 0: -976172
    4.     Stack Trace:
    5.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.Update()
    6.     PigeonCoopToolkit.Effects.Trails: Trail.Update()
    7.  
    8. Log (22:31:31.2683)
    9. Torpedo1 (UnityEngine.Transform).Update: Adding activeTrail mesh 1: -987102
    10.     Stack Trace:
    11.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.Update()
    12.     PigeonCoopToolkit.Effects.Trails: Trail.Update()
    13.  
    Torpedo0 gets run by Unity first, so in Torpedo0's LateUpdate, those meshes are combined into a single mesh.

    Code (CSharp):
    1.  
    2. Log (22:31:31.2683)
    3. Torpedo0 (UnityEngine.Transform).LateUpdate: combining mesh -976172 at 0
    4.     Stack Trace:
    5.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    6.  
    7. Log (22:31:31.2683)
    8. Torpedo0 (UnityEngine.Transform).LateUpdate: combining mesh -987102 at 1
    9.     Stack Trace:
    10.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    11.  
    12. Log (22:31:31.2683)
    13. Torpedo0 (UnityEngine.Transform).LateUpdate: Combined 2 meshes into -992338
    14.     Stack Trace:
    15.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    16.  
    In the next frame, Torpedo0 will be destroyed, but its Update still has a chance to run before its OnDestroy is called. It cleans up the previously created combined mesh, then adds its own trail mesh again to _matToTrailList.
    Torpedo1 also adds its own mesh when it runs its Update.
    When Torpedo0's OnDestroy is called, it calls Dispose on its trail and mesh. However, _matToTrailList still contains a reference to the trail.

    Code (CSharp):
    1.  
    2. Log (22:31:31.3193)
    3. Log (22:31:31.3263)
    4. Torpedo0 (UnityEngine.Transform).Update: Cleaning mesh -992338
    5.     Stack Trace:
    6.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.Update()
    7.     PigeonCoopToolkit.Effects.Trails: Trail.Update()
    8.  
    9. Log (22:31:31.3263)
    10. Torpedo0 (UnityEngine.Transform).Update: Adding activeTrail mesh 0: -976172
    11.     Stack Trace:
    12.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.Update()
    13.     PigeonCoopToolkit.Effects.Trails: Trail.Update()
    14.  
    15. Log (22:31:31.3263)
    16. Torpedo1 (UnityEngine.Transform).Update: Adding activeTrail mesh 1: -987102
    17.     Stack Trace:
    18.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.Update()
    19.     PigeonCoopToolkit.Effects.Trails: Trail.Update()
    20.  
    21. Log (22:31:31.3273)
    22. Torpedo0 (UnityEngine.Transform).OnDestroy: disposing activeTrail -976172
    23.     Stack Trace:
    24.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.OnDestroy()
    25.  
    Now that Torpedo0 has been destroyed, Torpedo1 is the first Trail instance to be run by Unity. Here, I put a check to determine if the mesh is null. This shows that the 1st entry in _matToTrailList (previously belonging to Torpedo0) is now null.
    Hence, Unity's Mesh.CombineMeshes() complains about the mesh instance 0 is null.

    Code (CSharp):
    1.  
    2. Log (22:31:31.3273)
    3. Torpedo1 (UnityEngine.Transform).LateUpdate: null mesh at 0
    4.     Stack Trace:
    5.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    6.  
    7. Log (22:31:31.3273)
    8. Torpedo1 (UnityEngine.Transform).LateUpdate: combining mesh -987102 at 1
    9.     Stack Trace:
    10.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    11.  
    12. Warning (22:31:31.3273)
    13. Combine mesh instance 0 is null.
    14.     Stack Trace:
    15.     UnityEngine.Mesh.CombineMeshes()
    16.     PigeonCoopToolkit.Effects.Trails: TrailRenderer_Base.LateUpdate()
    17.  
    Seems like it could be fixed by removing the trail from _matToTrailList in TrailRenderer_Base.OnDestroy:

    Code (CSharp):
    1.  
    2.             if (_activeTrail != null)
    3.             {
    4.                 if (_matToTrailList.ContainsKey(TrailData.TrailMaterial) &&
    5.                     _matToTrailList[TrailData.TrailMaterial].Contains(_activeTrail))
    6.                 {
    7.                     _matToTrailList[TrailData.TrailMaterial].Remove(_activeTrail);
    8.                 }
    9.             }
    10.  
    However, this would have to be before the GlobalTrailRendererCount check, otherwise _matToTrailList might be cleared and nulled afterwards.

    Would this be a viable fix?
     
    Last edited: Oct 19, 2014
  48. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    I just bought this asset and also sent an email but still no answer. I hope that this is not abandoned ware already.
     
  49. vapgames

    vapgames

    Joined:
    Aug 25, 2012
    Posts:
    9
    Hi, just started using the trail system. So far so good.
    Found a tiny bug, sometimes point's TimeActive() equals TrailData.Lifetime. Happens once in a blue moon (cause floats), but happens, and for one frame it causes a vertex number jump. I fixed it with replacing < with <= for every comparison that contains TrailData.Lifetime.
    Also moved updating from Update to FIxedUpdate, since otherwise trail length depends on FPS (and my game works on fixed timestep anyway).

    //manual batching is kinda bad, wrote my own rendering :D
     
    Last edited: Nov 12, 2014
  50. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Very cool you wrote your own rendering, would you be willing to share this code.
    Cheers.