Shooting raycast through canvas

I am rendering the game through RenderTexture for pixelated effect and when it’s enabled, I can’t shoot through it.

Canvas Disabled and Target Texture not set

Canvas Enabled and Target Texture set

Project files: 5.3 MB file on MEGA

After you add RT to the camera, camera’s width and height has changed. With the same mouse position and different width/height, camera.screenPointToRay generates a wrong ray. This should be a bug with camera and RT, we will fix it later.

Thanks for your reply! I’ll try to contribute on this issue.

1 Like