- Home /
Efficient ways to make a bullet tracer effect?
I tried using a line renderer and spawning a new gameobject and adding the line renderer to my shotgun blast, and it follows my raycast correctly (It looks good too). But it drops the fps about 30 frames every time I shoot. My game is a topdown shooter right now i just have left and right spread. It is also intended for mobile. What are some efficient way of visualizing raycasts as smoke trails of bullets?
Answer by cj31387 · Aug 07, 2013 at 12:21 AM
I solved it by creating a array of gameobjects that already have linerenderer on them (Caching them) and just changing the positions to where the raycasts shoot.
Answer by fafase · Aug 04, 2013 at 08:48 AM
Have you tried TrailRenderer instead?
It is like line renderer but instead of drawing from a point to another it just draws where the point is and live for a period of time. It might be develop to be more efficient than line renderer for this purpose.
Wouldn't that require a moving object though? I'm using raycasts.
Your answer
Follow this Question
Related Questions
Is there a way to draw particles on a raycast? 2 Answers
Raycast visible bullets 2 Answers
Raycast trail renderer? 3 Answers
LineRender in Raycast 1 Answer
Negative Positions Breaks Raycasts 1 Answer