Trail renderer with damage

I have seen some topics on Trail renderer collision, but none of it made sense to me. Do you use a script? Or is there some item on the Unity3d menui can use, I thank you in advance.

Unity3d - regular

Scripting exp - moderate

I don’t know how to make the trail renderer itself collide, but I have a suggestion how to do it if you are trying to make a bullet or anything similar that’s supposed to make damage to enemies or something…

I would make an invisible game object, for example, a small sphere (disable it’s mesh renderer but not the collider). Then add a trail renderer to it, adjust it’s settings for your liking, and make it a prefab (or whatever you need it to)

That would make a trail renderer that can collide! Hope you understand what I mean…

I’m going to go ahead with the assumption that you are referring to this thread in terms of what you didn’t understand. The idea proposed there is to get the points at which the trail renderer is creating it’s particles and doing a raycast between them.

Looking at the documentation, it doesn’t seem that it’s easy to get all the info you need from the object itself (you can set the minimum vertex distance, but I’m not sure how or if you can access that list of points) so I propose a different solution: fake it.

Make a series of small gameObjects with colliders (but no mesh renderer) inside the trail and just use unity’s regular features.