Here is the closest I’ve come to that. It does a raycast from the mouse to a triangle mesh. The camera has a fixed fov and orientation.
construct.net/en/forum/construct-3/your-construct-creations-9/3d-raycasting-obj-loader-test-167475
Basically it’s all from scratch with math as construct doesn’t provide anything that helps. Getting the ray direction from the mouse involves the inverse of the view and camera matrices. Construct doesn’t expose those, maybe you can find them with scripting, or like in that c3p you can make your own from scratch that matches. To simplify the math I went with using a fixed camera orientation.
Then it just does a Ray vs triangle calculation with a bunch of math. Construct doesn’t provide a way to access the mesh points or list of triangles so again, we have to build that ourselves and replicate the 3D objects with distort meshes.
With just cubes I think things can be simplified a lot. We’d still need to calculate the Ray direction from the mouse but if we used signed distance fields (sdf) of boxes we could do the actual Ray casting a bit faster.
Anyways, just thinking aloud here.