What I think is this madara had his eyes on Nagato when he was still little via Zetsu also on Obito while he was still very little due to their potentials and Madara told Obito that it was like he almost phased through the rock quote "almost" which hints he has the ability but it is yet to be activated, I think the whole attacks and all was planned to bring Obito to that cave, and the Kakashi/Rin incident is also engineered by Madara and Zetus to enable him activate th MS and make Obito stay. Am thinking after he sees Rin dies Madara will give him another sermon like...
Madara: I told you this world is full of hate and death, now u have a new power awakened by the death of someone close Rin I guess, then don't let it be a waste use that power to help me and achieve my moon eye plan and we could bring back the dead like ur beloved Rin.
Obito: can you really bring Rin back?
Madara: why would I lie to a brat...!
Obito (in tears and screams): Kakashi you should saved her you should have ....... I won't forgive you and Konoha and the mist and the whole ninja world you shall all go to dream forever.....!
Madara: we have one other problem the uchiha clan they betrayed me once and they could do it again and only them could break out of the IT genjustu and stop us from bringing Rin back, we have to eliminate them. We will use white Zetsu to copy some of their chakra and cause them to riot and create and opportunity to eliminate them, I told you about my eyes earlier I gave them to a kid named Nagato, I want you to assist him and at the right time with my eyes he shall awaken me and Rin. I am weak and tired now Zetsu will explain the rest to you and you also have a part of Zetsu in you use that to copy my chakra and I will transfer my remaining chakra and power and will to you Uchiha Obito use my name to put fear in people until am awakened.
Madara dies .....!