Hi,I have code that uses a RayCast and creates a primitive object at the location. To create the primitive I set the position of it to (x, rayOrigin.y - hit.distance, z). Theoretically this should work fine. When I run the code all the squares I create seem to be in the right place visually, but, when I click on them, the inspector reports the x and z values correctly but the y value is completely off!
The y coordinate for this one is -2.2053 (but its actually at 0)
The y coordinate for this one is -7.1525 (but it’s actually at 0 as well!)
Something that I checked before posting is whether the model might be rotated, and it’s not, its right on the x and z axis, and perpendicular at all points to the y axis, therefore there should not be any changes in height due to rotation. In addition in other points of the map where the height of the floor is not 0, the height of the created object is correct (uh what?).
I’m worried it might cause miscalculations, say, if I wanted to store this height and use it later to create an object or vertex. Is this a known glitch, or is it something I didn’t take account for?
P.S: I don’t know if this plays a role but the floor is a flat grid made on blender with some areas of extrusion (areas shown in pic are flat and not extruded).