I am really confused with indirect and direct objects ...
I need to understand the sentence pattern for this sentence:
He showed kindness to his parents.
Your original sentence has no indirect object.
Here kindness is the direct object, and his parents is the object of the preposition to — it is not an indirect object there.
In this sentence:
Now his parents is indeed an indirect object.
Similarly, this has an indirect object:
But this does not:
Setting aside scheme differences, that is, acknowledging that any scheme is sufficient that allows the sentence pattern to be well-represented for the purposes of a given analysis, one complete explication of the pattern is this:
- Subject + Verb + Indirect Object + Direct Object (S-V-IO-DO)
An indirect object tells for whom or to whom. If the indirect object comes after the direct object (in a prepositional phrase "to ________" or "for _______"), the sentence pattern is shown as S-V-DO-IO. Pronouns are usually used as indirect objects (but not always).
(From English Mistakes Welcome.)
The pattern that applies to the example in the question is S-V-DO-IO (the second pattern mentioned in the quote, where the indirect object is presented as a prepositional phrase). The example given in the question might have been
He showed his parents kindness.
In that case, the pattern would be S-V-IO-DO.
Note that no sentence patterning scheme is correct or incorrect, just as no one terminology is correct or incorrect. Both, the sentence patterning scheme and the terminology used, may be more or less suited to a purpose than another scheme or terminology. For example, if we say that the example sentence is a pronoun, verb, noun and prepositional phrase containing a pronoun and noun,
He showed kindness to his parents
PN V N pP : PN N
the patterning scheme, and terminology, might better suit the aims of a particular analysis. Outside of a purposeful context, neither scheme is more or less correct or right. The scheme, and the terminology, can only be judged by its usefulness for an expressed purpose.
For example, if your purpose is to analyze your own writing (in an effort, perhaps, to make it less monotonous), I would generally favor the first patterning scheme (from English Mistakes Welcome) over the second (contrived on the spur of the moment by myself), simply because the second one doesn't show the general pattern but a more specific one that omits relationships. Thus,
He showed his parents kindness
PN V PN N N
is not clearly seen to be related to an alternative phrasing of the same thought. Obviously, I've stacked the deck against my contrived scheme by using the always-suspect parts of speech rather than syntactical relationships as the terminological and schematic basis of the sentence pattern, yet for a simple analysis of the proportions and placements of nouns, pronouns, prepositions and verbs in the sentences in the writing analyzed, my contrived scheme may be the better tool, simply (again) because the first scheme does not show the presence of a preposition.
Note also that the long-winded easily-faulted answer I've provided is no better an answer to the question asked than the answer provided by Ataraxia. Mine only details the what and why omitted from the original question. And, again, another, or several other, sentence patterning schemes or terminological bases, might prove to be better tools for the purposes of a given analysis.
[Editorializing: This question would probably have been better served by being asked on ELL. Unfortunately, ELL didn't exist at the time the question was asked. However, given the two previous irreconcilable answers, and the complaints in the comments, it's difficult to see why the question wasn't closed for the reason that it's "unclear what you're asking". If you're asking what seems clear to me, whether a prepositional phrase can function as and be called an indirect object for the purpose of patterning the sentence, the simple answer is "yes".]