Matthew Perry wanted to leave a lasting legacy beyond his fame as Chandler Bing ... in the form of a foundation dedicated to helping folks suffering from substance abuse.
Sources close to the late actor tell TMZ ... in the months leading up to his death, Matthew was in the early stages of creating the foundation ... akin to what Betty Ford did with her Foundation near Palm Springs.
While Matthew died before he could turn his dream into reality, our sources say several people close to him want to pursue the foundation in his honor ... and they're planning to move forward and get it up and running.
Remember ... Matthew was open about his history with substance abuse -- it's a big topic in his book -- and by all accounts he was sober, using pickleball as an outlet to help with his recovery.
Matthew wanted his legacy to be helping people who are struggling with substance abuse, and not his starring role on "Friends." The foundation could have done the trick.
It will be interesting to see how Matthew's vision for a foundation takes shape.