Oftentimes, when you create a VNgen entity at a certain position, or modify it with a certain rotation and scale, the final values shown on-screen don't match the values specifically set in qScript. The perspective, global offset, animations, and other factors all contribute to the final values applied to a given entity before being drawn. This entire process happens transparently, and in some cases you may not even be aware VNgen is making adjustments to ensure everything behaves as you expect! However, this becomes a challenge when integrating your own code and assets with VNgen scenes, as VNgen elements may not appear with the exact coordinates, dimensions, and rotation they were created at.
To solve this problem, each frame, VNgen records the final properties for major entities where they can be retrieved using
vngen_get_* scripts. While seemingly insignificant, using just this simple data it's possible to integrate your own visual elements or even create entirely new forms of interactivity for your projects. For example, try combining these functions with
mouse_check_region to detect when the user has clicked on an object in the scene!