Just prepare for raycasting feature ! Make sure the code is oriented and shaped and what have you such that determining the object situated at Viewport[0.5, 0.5] and doing something with it is easy. Especially doing the action on a keypress!
I think i might do this by figuring out the RaycastTarget once per frame (or less !) and letting that be accessible to everything else by a reference. Right now my two use cases of interact and hold do not need an exact world-space coordinate. Just the object is fine.
Just prepare for raycasting feature ! Make sure the code is oriented and shaped and what have you such that determining the object situated at Viewport[0.5, 0.5] and doing something with it is easy. Especially doing the action on a keypress!
I think i might do this by figuring out the RaycastTarget once per frame (or less !) and letting that be accessible to everything else by a reference. Right now my two use cases of interact and hold do not need an exact world-space coordinate. Just the object is fine.
Actually, remember the distance is important !!!