02-04-2024, 12:02 PM
Hello,
Loving the tool so far, but I am wondering if there is a way to avoid GC allocations on control point position changes at runtime?
I am trying to match a spline with 'anchors' I have on a moving object and currently using the following code in update:
But this is incurring ~1.2KB GC each frame (8 control points). Is there a way to update spline control points at runtime without GC allocations?
Thanks,
Elliott
Loving the tool so far, but I am wondering if there is a way to avoid GC allocations on control point position changes at runtime?
I am trying to match a spline with 'anchors' I have on a moving object and currently using the following code in update:
Code:
controlPoints ??= wormRail.ControlPointsList;
for (int i = 0; i < anchors.Count; i++)
{
controlPoints[i].SetPosition(anchors[i].transform.position);
}
But this is incurring ~1.2KB GC each frame (8 control points). Is there a way to update spline control points at runtime without GC allocations?
Thanks,
Elliott