Search Issue Tracker

Postponed means that the issue was either a feature request or something that requires major refactoring on our side. Since that makes the issue not actionable in the close future we choose to close it as Postponed and add it on our internal roadmaps and technical debt pages instead.

Postponed

Votes

3

Found in [Package]

10.0.0-preview.26

Issue ID

1270088

Regression

No

[URP] OnMouse methods are not called when using Camera Stacking with different Culling Masks

Package: Scriptable Render Pipeline Universal

-

How to reproduce:
1. Open attached "CameraStackIssue" project
2. Enter Play Mode
3. Try to click on the cube in the Game View
4. Click on the LevelCamera in the Hierarchy window
5. Enable and disable LevelCamera in the Inspector window
6. Click on the cube in the Game View
7. Observe the console

Expected result: Debug messages are printed before and after enabling and disabling the LevelCamera
Actual result: Debug messages only appear after enabling and disabling the LevelCamera

Reproducible with: 7.4.3(2019.4.8f1), 8.2.0(2020.1.2f1), 10.0.0-preview.26(2020.2.0a20)

Note:
- All OnMouse method related to colliders don't work (OnMouseEnter, OnMouseExit, OnMouseDrag, OnMouseOver, OnMouseDown)

  1. Resolution Note:

    This case has been postponed, unfortunately this will be tricky to solve and will require lower level work between the engine and URP. As a work around I would advise to enable and disable overlay cameras after they are loaded. This should provide a work around to the issue. My apologies, the issue will be tracked internally and this case will be reopened when it is being worked on.

Comments (4)

  1. ramd21

    Sep 05, 2022 02:47

    I found a solution.
    To solve this problem set Camera.clearFlags to depthOnly.

  2. HofiOne

    Dec 11, 2021 00:14

    for me none of the above mentioned helped

    my setup was

    - base camera with two overlays
    - one of them is rendering only UI (UICamera)
    - the UI Canvas render mode is "Screen Space - Camera" and the Render Camera is set to the UICamera

    in my case the solution was to set the Canvas "Plane distance" greater then 0 (actually > 0.01 but that one is another story)

    so, set Plane distance e.g. to 1

    hope this helps someone too

  3. kolex023

    Aug 06, 2021 08:45

    To have it documented here as well:
    A fellow Unity dev (mikeohc) has found an easy solution:
    Set the MainCamera or the Base camera higher priority. It's Worked for me.

    Original post:
    https://gamedev.stackexchange.com/a/192016

  4. lloydv

    Jul 31, 2021 01:58

    Additional info: In my case I have an overlay camera for UI which is at a different world position than the base camera. The issue is the same if the cameras are at the same position, but mouse events do not respond if the positions are different, so it seems that Unity is using the overlay camera position to detect the touch instead of the base camera? The physics raycaster is on the base camera.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.