- Home /
How to adjust collision detection according to URP viewport rectangle change
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@10.4/manual/cameras.html
Universal RP, Using the camera stack function, draw 3D and UI with multiple cameras, 3D click judgment is performed with each camera, The UI uses uGUI standard features.
When changing the viewport rectangle of the base camera
The image of the stacked cameras is also drawn with the base viewport rectangle.
At that time, the click judgment of 3D or UI does not move according to the viewport rectangle, As a result, the click hit detection is different from what it looks like.
Since 3D collision detection is done by Raycast, I think that if you adjust the click coordinates according to the value of the viewport rectangle, it will somehow match the appearance.
Since the UI is hit-judged inside uGUI, Judgment cannot be adjusted from here.
URP, camera function or something Is there a way to match the collision detection?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to adjust collision detection according to URP viewport rectangle change 0 Answers
Getting the Camera to Match the Size of the canvas with dynamically added UI elements 1 Answer
Clamp To The Screen Edge 0 Answers
"Top" Depth only camera Culling effects bottom camera 0 Answers