OnMouseDown Problem when using Target Texture

Hi,

I have simple scene: a small script (see below), a cube, a plan, two cameras and a rendering texture.

UPDATE: Here you can download a small test scene.

In that scene I use the plan as an ingame screen by setting the rendering texture as the target texture of the second camera and using a material with the rendering texture as the plan material.

Then I add my script to the cube.

The script includes only this function:

void OnMouseDown()
{	
	Debug.Log(gameObject.name);
}

When I start the scene everything looks good. But when I click on the cube, nothing happend. When I deactivate the second camera everything works. :frowning:

My current camera settings:
Main Camera: tag maincamere, depth -1
second camera: tag untagged, depth 1

When I use the second camera as a normal camera (for displaying other layers etc.), my script works. But when I use a rendering texture as a target texture it doesn’t…

Any ideas?

Has anybody an idea or does nobody have that problem?

Post ur project if it small, may be i can help u

Hi Ram Thakkar,

that would great. Here you can download a small test scene.

Any progress on this? I am having the same problem.