7:1
The Lord then said to Noah, “Go into the ark, you and your whole family, because I have found you righteous in this generation
7 By faith Noah, when warned about things not yet seen, in holy fear built an ark to save his family. By his faith he condemned the world and became heir of the righteousness that is in keeping with faith
5 The Lord saw how great the wickedness of the human race had become on the earth, and that every inclination of the thoughts of the human heart was only evil all the time. 6 The Lord regretted that he had made human beings on the earth, and his heart was deeply troubled. 7 So the Lord said, “I will wipe from the face of the earth the human race I have created—and with them the animals, the birds and the creatures that move along the ground—for I regret that I have made them.” 8 But Noah found favor in the eyes of the Lord.
Yes of course Noah and his family went into the ark but as the verse you showed said God said “because I have found you (Noah) righteous.” Not because your family is righteous.