- Home /
How to acquire player position on render texture?
I have two cameras, one is an orthographic with the ability to rotate at 45 degrees around the player. I have it set large enough to project the entirety of my game space.
My other camera is focused on a render-texture. I want this camera to pan around the render-texture following the player.
I do not understand how to acquire the position of the player on the render texture.
I first thought I could position the render-texture quad above the game-space, then parent the camera to the player, however with rotation the camera goes in the opposite direction at times.
I have tried looking into WorldToScreenPoint, but I'm not quite sure how to implement it into my setup as the results are numbers that exceed the bounds of the render texture.
Answer by and_bloom · Nov 10, 2021 at 08:06 AM
Solved it by using WorldToViewportPoint conversion of the player location.
Your answer
![](https://koobas.hobune.stream/wayback/20220613045141im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity ortographic camera panning within boundaries issue 0 Answers
How to use a non-screen-sized RenderTexture? 1 Answer
Shader: get size of a pixel for orthographic camera 2 Answers
translate a point between two cameras 0 Answers
Can a rendertexture be placed on top of an image? (Minimap help) 0 Answers