I am trying to position an object in 3d space based on a user touch.
My plan is to get a ray and find its intersection with a “floor” plane.
What do I need to pass to screenPointToRay ? when I pass e.getUILocation() I get a ray that is very far from the camera location.
let ray = this._3dCamera.screenPointToRay(uiLocation.x, uiLocation.y);
Do I need to call screenPointToRay on the 2d camera instead? Or pass a different value?
I’m using cocos creator 3.0.0.
This was not working because my camera was offset in the world; ray.o was close to the world coords of the camera.
Removing the camera offset and changing to e.getLocation fixed it.