First, take a look at the following scenario:

See where the mouse is on the right side of the screen? I want to be able to click (already taken care of by binding something to the GlobalActionMap) and detect that it has clicked on the green brick. I've tried a few things, including finding the offset of the cursor from the center of the screen and retrieving an angle to fire a raycast at. However, this doesn't work in all scenarios - for example, in the above one, there are blue bricks blocking it from the centerpoint of the view.
Do any of you out there know how to do this? Remember that I can use both server and client functions since this would be ran in a singleplayer server, so feel free to reference anything you can. I think Nitramtj has done something similar, but I haven't been in contact with him since this problem arose. Also, unless it's a very educated one, please don't just throw a guess out on the table, since that won't help me nor other users that may be curious about doing this in the future.