There's no function in the engine ATM, but you may find
this SO question useful.
Edit: If you only need the face, you can take a shortcut by comparing the `above` and `under` fields of the `pointed_thing` parameter to `on_punch`: `under` refers to the node itself, while `above` refers to the pos of the node that would be "against" the clicked face (not necessarily in the +Y direction).
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
local u, a = pt.under, pt.above
if u.x<a.x then -- Clicked on +X (i.e. east or right face)
elseif u.x>a.x then -- Clicked on -X (i.e. west or left face)
-- and so on for (+/-)(Y/Z)
Edit 2: Also note that the above does not take into account any possible node rotation.
HTH