Page 1 of 1

Problem with getting pointed_things from raycasts

Posted: Wed Apr 22, 2020 20:00
by Eran
Hi, I'm making a mod that places a temporary, invisible, non-walkable but pointable build helper node where the player is looking when pressing E, like this:
Image
Or like this:
Image

However I have a problem:
When I point at the side or the bottom of a node at certain angles pointing upwards, the node is placed one too low. Like this
Image This does not seem to be because the helper node is placed on another helper node, but because the pointed_thing.under and pointed_thing.above (retrieved by raycasting) are one too low.
And I can't figure out what I did wrong. Can someone here help me? I've uploaded the code here.