Miley Cyrus had her role in 'The Last Song' written for her.

The 17-year-old actress admits she was "amazed" when novelist Nicholas Sparks - who wrote the original book and the film's screenplay - sat down with her and told her the story of troubled youth Ronnie Miller, which he had based on her.

She said: "I remember the first night he told me the story. We were sitting at a long dinner table at my house and I turned the lights down, so there was a great atmosphere.

"It was amazing to hear the story from the author himself and find out what he envisioned. It's clear to me he had worked some of my mannerisms and personality into the character."

The star also admits she became close to her on-screen father Greg Kinnear because he is like her real dad, country singer Billy Ray Cyrus.

She said: "Greg and I got along really well, we became really close. He's a lot like my dad. He has an awesome sense of humour."

However, she also claims the film - in which she falls in love with well-off teenager Will Blakelee (Liam Hemsworth) - is not like real life.

She told Britain's Metro newspaper: "It's definitely portrayed more idealistically than it is in real life because with first love you are probably going to get your heart broken."

'The Last Song' is released in the US tomorrow (31.03.10) and worldwide in April.