The people of Indus valley did have toilets in their homes, so were there toilets in the times of Mahabharata or Ramayana? Does any Hindu scripture mention about toilet system?
I have not come across any direct reference to toilets. However, Bhishma forbids answering the calls of nature in inappropriate places. It is not clear if this suggests that there were toilets during that time or that this was an advice to answer the calls of nature far from habitation.
Bhishma said, 'They that are good or righteous, O monarch, never answer the two calls of nature on the public road, or in the midst of a cow pen, or on a field of paddy.'
Mahabharata Anusasana Parva Section CLXII