I want to try trail renderer face to Y axis not camera, but there is no setting value for me, Can I set trail renderer not face to camera? Or something instead it?
asked Jun 22 '11 at 12:55 AM
I'm not sure I understand, but I believe you are misunderstanding the usage of the trail renderer.
The trail renderer generates a mesh at run-time that is effectively 2-dimensional (it has a width and height but no depth as it is planar)
So, by that logic, in order for it to be apparent in 3D space it always needs to face the camera (term: "billboarded"). This is done when the mesh is dynamically generated by the TrailRenderer component, so you don't have any control of telling it to do something otherwise.
From what I understand, you want is a dynamic mesh that behaves similar to a TrailRenderer, to follow a Game Object with a set amount of decay, but you don't want it to face the camera, but rather always face up. Is that correct? Leave me a comment and I may be able to point you in the correct direction.
Glad to see I understood. As Christian commented, you will have to create a component which essentially does the same thing as the Trail Renderer & Line Renderer, but instead does not dynamically orient the faces of the generated mesh to always face the camera.
In order to achieve something like this you will need to have reference to the object your custom trail renderer will be following. From there you will need to know your way around the Mesh class. You will probably be adding a new face to the mesh every frame, connecting the most recently created face to the transform of your target. You will likely also want to remove very old faces based on some level of decay.
Unfortunately I don't have time to mock up any pseudo-code or write examples but hopefully that's a push in the right direction for you.
Nope, is your answer. Look at the Procedural examples on the Unity resources page. It has what you need here, (TRON Trail). It works just like a trail renderer just without billboarding, so it twists and turns with the orientation of the gameobject it's on.
answered Jun 25 '11 at 08:30 PM