- Home /
Managing & raycasting to multiple world space canvases
I have a project in which I want to show one (or possibly more) 3D objects within a 2D scene. To do this, I've got additional cameras which render to RenderTextures and are then shown using a RawImage.
However, I also want to be able to have one or more world space buttons with the 3D object and have those fire when clicked, and that's when things get a bit tricky.
I have written some code related to figuring out the position of the click, but what I wanted to ask about is these world space buttons themselves.
Should these each be a separate world space canvas each with its own GraphicRaycaster, which I then invoke through its Raycast() method to determine if there is a hit? I am a little confused about the behavior of a GraphicRaycaster attached to a world space canvas.
The GraphicRaycaster has to be on the same object as the canvas, right? I can't have a single raycaster on a parent object which would detect any of the canvases?
Your answer
Follow this Question
Related Questions
How can I select a UI element with a raycast from another UI element? 2 Answers
World Space Canvas causes blurry text with anti-aliasing 0 Answers
How do I convert a point in the world to coordinates on a world space canvas? 0 Answers
UI interaction via RenderTexture 0 Answers
Canvas interaction on render texture to message PhysicsRaycaster 1 Answer