Isometric Camera ScreenToWroldPoint with fixed Y results

When I use Camera.main.ScreenToWorldPoint on mouse position, I am getting my object placed correctly in the game view. Orthographic Camera, with 45,30,0 rotation for isometric. The issue is; I need to translate that return to fix the y position at 1, and have the x and z position adjust to keep the gameview correct.

Thank you for any advice.

Say your position of the object spawned is p. And you have your camera forward vector fwd. Then:

float k = (1-p.y)/fwd.y;
p = p+fwd*k;

Then p should now look like the same position in the view port, but be at height 1. However it may be better to do this by setting the z value passed to Camera.main.ScreenToWorldPoint, differently, as the z value in the parameter passed, controls how far away from the camera the position returned is.

Thank you. Scribe. I think I may have asked the question poorly; I don’t quite understand your solution. The Camera is stationary, I don’t think it would have a forward vector? It also looks like you are transforming the position based on the delta between frames, This isn’t an option for me because I need to round to have the object Snap To my grid, if you moved an object over several frames it would ‘fall off’ or ‘jump ahead’ because of rounding errors. I need to get the position each frame from the mouse/touch input.

From my post till now, I found an almost solution, but I don’t fully understand it.

`void Update () {

	m = Input.mousePosition;

	m = new Vector3(m.x,m.y,m.z);

	p = Camera.main.ScreenToWorldPoint(m);

	mouse.transform.position = new Vector3(p.x+(p.y/.833f)+1,1,p.z+(p.y/.833f)+1);} `

Y is the adj, the angle is 30 degrees I need to find the base, or where the image is projected.
TAN(pi/6) = x/y AND TAN(pi/6) = z/y …Respectively X=Y/.577 and Z= Y/.577

The position, += the projected Y position is p.x+p.y/.577. This works at low values, but starts jumping off as it gets further from the origin.

Using the p.y/.833 is seeming to track well, but it is a ‘guess and check’ and I am not sure why. This may be because of the additional 45 degree rotation? The 45 degree rotation about the Y axes, makes the 30 degree rotation 1/2 between the x and the z axes, but the math is over my head.

I would like to have the number correct so it will stay correct 1000s of units from the origin.