Calling functions from a separate, unique script using a ray cast.

So in my game there will be 3 main types of items: equippables, consumables, and movables.
Each of those types of items will have a different way of interaction: right-click, e, and left-hold respectively.

Once the correct interaction button for the items type is used I want to call a function on a script attached to the object itself.

I want to do this using a raycast. How would the raycast know what interaction button is correct for the object it hits, and then how would I call the function of the script attached to said object?

Using Interfaces in Unity3D:

Check Youtube for other tutorials about interfaces and working in Unity3D. It’s a pretty powerful combination.

In your case, use GetComponent() to find the interface on the thing you hit with the raycast!

Alright, thank you for the info!