Hi, I’m trying to create a mechanic that allows the player to interact with a button. The way I want to lay it out is by using a raycast and having it call a function on the object that the ray hits.
I was wondering if there is a function similar to oncollisionenter, so that when a ray hits that object, it will call the function attached to the object being hit by the ray.