So I want to make a wave attack, I’m using a LineRenderer to create this wave. (See image 1)
The problem comes with creating a hitbox that deals damage ONLY if the units overlap the wave.
With LineRenderer.BakeMesh I generate a mesh that I feed to a MeshCollider.
But because a MeshCollider can only be a trigger if it is Convex the shape of the trigger becomes a half-circle. (See image 2)
How can I create a trigger collider that follows the shape of the wave correctly?
Wave attack.

Half-circle collider shape.

You have a very nicely-curving LineRenderer there which makes me think you have a fair number of actual points involved in making it. Why don’t you attach the same number of SphereColliders to that GameObject and each frame set their local offset from the LineRenderer relative to the master GameObject so they pretty much cover the arc?
However, I think if a unit (which has the Rigidbody for trigger sensing) is stationary and it gets hit by a moving collider, I am not sure it triggers… so you might need some other mechanism, such as iterating the points and seeing if they’re close enough to damage the unit. Not sure really… might get fiddly. Generally if you want to move a collider into a non-moving Rigidbody, you need to add a kinematic Rigidbody to the thing you’re moving…
@Kurt-Dekker
I used BoxColliders to fit the shape better. But unlike the SphereColliders you recommended, they require a gameobject to be oriented to the next point.
private void SetBoxes(List<Vector3> _points)
{
for (int i = 0; i < BoxCollidersCount; i++)
{
var currentPoint = _points[i];
var nextPoint = _points[(i+1) % PointCount];
SetBox(BoxColliders[i], currentPoint, nextPoint);
}
}
It does mean creating quite a bit gameobjects
.