click object on renderTexture

Hello.

I’m building a project where I have a plane in front of main camera, wich is textured with a renderTexture.

This render texture is the result of another camera.

Now I want to click on the object appearing on renderTexture and have interaction. I mean, I need to click objects that appear on renderTexture and be interacting with world objects.

Any idea to solve this?

Thank you

You will have to determine where on the RenderTexture the user clicked (using RaycastHit.textureCoord to get the normalized viewport coordinates. Then use Camera.ViewportPointToRay to “continue” the ray from the camera linked to the RenderTexture.

3 Likes