I never really had an imaginary friend in the normal sense beyond preschool, but on a similar note I was really obsessed with dinosaurs. I would watch a bunch of those documentaries about dinosaurs and pretend to be a dinosaur in my yard, my play as a child was very solitary and very dependent on my imagination. I would do this alone in the schoolyard actually, I was never good enough at sport to play that or even interested in it because I was (and still am) so uncoordinated so I just played alone with imaginary shit.
I played with a bunch of toy dinosaurs, often narrating what was going on like it was one of the documentaries my parents would put on for me (I remember being very young and having my dad come out at 6 am telling me to be quiet because I was doing it too loudly). I would talk mostly about dinosaurs and subjects adjecent to dinosaurs to anyone who I thought was on friendly terms with me or who I thought might have been interested (they weren't). I remember playing with toy dinosaurs on a green wooden table that I called "the dinosaur table" until I was about 9 or so and my mother moved out after divorce raping my newly-disabled father so she could whore around in front of me and piss the money she got from him down the drain, after that the table was left on the veranda of the house to rot and a drunk landwhale who used to live there broke it by waddling to the house and collapsing on the table early one morning. I didn't think much of the destruction of the table at the time because I hadn't used it in a while, but thinking about it now kind of makes me angry because of what it's connected to.
All of this behaviour stopped when I was about 12.
It all seems very pathetic when I look back at it, and it kills me to think about how upset me as a child would be with that (and with who I am now). I don't feel like the same person I was back then, but I am genuinely sorry for the way I feel like I've shit all over past me and my access to his subjective experience, I don't think there's anything I could do to make it up to him, but I am also embarrassed by how autistic he was. I really wish I got to be a different person between the ages of 0 and 12 at the very least.