Calling a function from whatever script a RayCast hits

I have a RayCast script which checks if you are looking at a specific tag and if you press Mouse0 it will call an Interact() function.

But I have multiple scripts with the Interact() function. I want to make it so the Interact() function is called only from the script that the RayCast hits.

How would I go about this?


Thanks for answering, I’m working on the other two options right now but I noticed that “raycastHitInfo” isn’t recognized as anything. How come?