That is correct. Your original post did not specify that the object had more than one texture assigned to it.
To give you a more accurate method could you share the model or image of the model and what you are trying to achieve.
Depending on your needs, it may be better to break the model apart into clickable targets than try to calculate where a user is clicking and then determine the material. Not that it’s impossible, to do, just a matter of workload vs other potential options.