Question about base class references

My OOP class is a little far in my memory, we probably talked about something like this but its the kind of issue that I run into so rarely that I completely forgot how to solve it (if its possible).
Long story short, I'm making an animation engine that's kind of the C# version of Manim (or, at least, I'm trying to) and I wanted to make an animation which creates a line by interpolating its end point from its start point to whatever the target end point is.
The way an animation works conceptually is that I describe its initialization and finalization Start() and End() methods, and then I update the target object's state with the Update(float dt) method.
The issue (i think, at least) is rooted in the fact that the base Animation class takes in a FrameObject (the base class for every object, including Line), but the line creation animation takes in a Line, since it obviously wouldn't make sense to apply this function to a circle or something.
What I tried doing was something like this
class LineCreate : Animation 
{
    Line l => AssertTargetIsLine(Target);
    Vector2 finalEnd;

    static Line AssertTargetIsLine(FrameObject target) 
    {
        if (target is not Line l)
            throw new Exception("Target object must be a line");
        return l;
    }
    
    public override void Start() 
    {
        finalEnd = l.End;
        l.InterpolateEnd(0, finalEnd);
        base.Start();
    }

    public override void Update(float dt)
    {
        float percent = LocalTime / Duration;
        percent = EaseFunc(percent);
        l.InterpolateEnd(percent, finalEnd);
        base.Update(dt);
    }

    public override void End()
    {
        l.InterpolateEnd(1, finalEnd);
        base.End();
    }
}

However, the line isn't updating. I know the issue isn't the methods for moving the endpoint, so i feel that it has to be that the reference is not the same, but i'm not sure what to do to solve this.
Was this page helpful?