The concept of Maya answers your question.
In Indian philosophies, Māyā is ... a spiritual concept connoting
"that which exists, but is constantly changing and thus is spiritually
unreal", and the "power or the principle that conceals the true
character of spiritual reality". - Wikipedia - Maya
(illusion)
The idea is summed up nicely in the Lankavatara Sutra.
In the following quote, the 'real world' is not discounted; just subjective reality is called illusion, because it is prone to error and manipulation. Nevertheless, how could the 'real world' be known, except to say something has furnished the material (matter and minds) for subjective, illusory perception.
Mahamati, since the ignorant and simple-minded, not knowing that the
world is only something seen of the mind itself, cling to the
multitudinousness of external objects, cling to the notions of being
and nonbeing, oneness and otherness, bothness and not-bothness,
existence and non-existence, eternity and non-eternity, and think that
they have a self-nature of their own, all of which rises from the
discriminations of the mind and is perpetuated by habit-energy, and
from which they are given over to false imagination. It is all like a
mirage in which springs of water are seen as if they were real. They
are thus imagined by animals who, made thirsty by the heat of the
season, run after them. Animals, not knowing that the springs are an
hallucination of their own minds, do not realise that there are no
such springs. In the same way, Mahamati, the ignorant and
simple-minded, their minds burning with the fires of greed, anger and
folly, finding delight in a world of multitudinous forms, their
thoughts obsessed with ideas of birth, growth and destruction, not
well understanding what is meant by existent and non-existent, and
being impressed by the erroneous discriminations and speculations
since beginningless time, fall into the habit of grasping this and
that and thereby becoming attached to them.
It is like the city of the Gandharvas which the unwitting take to be a
real city though it is not so in fact. The city appears as in a vision
owing to their attachment to the memory of a city preserved in the
mind as a seed; the city can thus be said to be both existent and
non-existent. ...
It is like a wheel of fire made by a revolving firebrand which is no
wheel but which is imagined to be one by the ignorant. Nor is it
not-a-wheel because it has not been seen by some. By the same
reasoning, those who are in the habit of listening to the
discriminations and views of the philosophers will regard things born
as non-existent and those destroyed by causation as existent. It is
like a mirror reflecting colors and images as determined by conditions
but without any partiality. It is like the echo of the wind that gives
the sound of a human voice. It is like a mirage of moving water seen
in a desert. In the same way the discriminating mind of the ignorant
which has been heated by false-imaginations and speculations is
stirred into mirage-like waves by the winds of birth, growth and
destruction. It is like the magician Pisaca, who by means of his
spells makes a wooden image or a dead body to throb with life, though
it has no power of its own. In the same way the ignorant and the
simpleminded, committing themselves to erroneous philosophical views
become thoroughly devoted to the ideas of oneness and otherness, but
their confidence is not Well grounded.