sizraide 4 Posted May 14, 2022 Hello, I'm using screenToWorld [0.5, 0.5]. But it only returns the position on landscape. I'm wondering how do I retrieve the position of what the player is looking at if it's in the sky? But only for 100 meters in distance. So for example, if player is looking at sky. Get the position of 100 meters distance relative to the players eye view. Because I'm trying to create a cutscene but the player is unfortunately looking at the sky in this scene. And I want to camera to eventually move into the players perspective for a smooth camera to player transition EDIT: The player is not looking at any object in the sky, just to clarify. _camera camPrepareFov 0.24; _camera camPreparePos [9212.05, 19240.1, 1.26343]; _camera camPrepareFocus [22.29, 1]; _camera camPrepareTarget getPosATL camera_tents; _camera camCommitPrepared 0; _camera camSetFocus [-1, -1]; _camera camPrepareFOV getObjectFOV player; _camera camPrepareTarget screenToWorld [0.5, 0.5] // Trying to change this position _camera camPreparePos ASLToAGL eyePos player; // Move camera position into players eye position _camera camCommitPrepared 13; Share this post Link to post Share on other sites
_foley 192 Posted May 14, 2022 Basically, you can take eye position of the player and add eyeDirection to it, multiplied by the distance (100m in your case). It goes like this: _positionInSky = (eyePos player) vectorAdd ((eyeDirection player) vectorMultiply 100); This position will be in PositionASL format, so you might need to also add ASLToAGL like in your script. 3 1 Share this post Link to post Share on other sites
sarogahtyp 1109 Posted May 14, 2022 Position format of eyepos player is ASL. You probably want to convert it to AGL using ASLToAGL. 3 Share this post Link to post Share on other sites
sizraide 4 Posted May 14, 2022 2 hours ago, _foley said: Basically, you can take eye position of the player and add eyeDirection to it, multiplied by the distance (100m in your case). It goes like this: _positionInSky = (eyePos player) vectorAdd ((eyeDirection player) vectorMultiply 100); This position will be in PositionASL format, so you might need to also add ASLToAGL like in your script. It works! I appreciate your help. Share this post Link to post Share on other sites