From what I’ve heard, Will Smith’s father actually left him. This wasn’t entirely scripted. Will went off on his own rant, and the hug at the end was genuine.
^ That’s all true. The episode was made around the time Will’s dad came back because Will was achieving success on the show I think, so all the emotions in this final scene are completely raw and unscripted and perfect.