So I have a bit of a different scene set up. I have the default 3D Orbit Camera script to rotate around an object. However, I have modified the camera.rect parameter to offset the camera slightly to the right of the window.
So my next step was to add the “Collision Picking” raycasts to select entities that the camera is rotating around. However, the raycasting is not working correctly.
I assume because the camera.rect is not (0,0,1,1) these lines need to be adjusted to account for the offset, but I cannot seem to get it to work correctly.
var from = this.entity.camera.screenToWorld(e.x, e.y, this.entity.camera.nearClip); var to = this.entity.camera.screenToWorld(e.x, e.y, this.entity.camera.farClip);
Has anyone solved this issue before? I have been struggling with it for some time with no luck. Any help would be greatly appreciated!