Hi all! I'm struggling to get raycasting to control UI elements in a seperate scene by raycasting on a quad with a render texture. I can get it to work and manipulate 3D objects just fine, but I can't register hits on the UI objects in the target scene. Are there any tutorials online that demonstrate this specific thing? Or any code that y'all can share of accomplshing something similar?
#Manipulating UI elements on canvas through a render texture/quad?
1 messages · Page 1 of 1 (latest)
The canvas needs to be world space and have 3d or 2d colliders on the objectd
Though you should use the normal UI interaction system
@vague gazelle thanks for tips! i do have a graphic raycaster on the canvas in the target scene. and imagaes set up to recieve ray hits in the target scene as well. In fact, if I go into the target scene by itself, and just run it with an event handler inside that scene, all the UI elements work fine. It's just when disabling the event system and trying to get it to work in the main scene is the issue (passing the events into the raycast/rendertexture.) I do not have my UI canvas in the target scene in world space though. It doesn't work if it's attached to the camera in screen space?
an event system is required for input so why disable it?
im confused what you want. a overlay canvas will work regardless of the scene its in
i have an event system in the main scene, but i have to append load the scene with the rendertexture camera into my main scene to get it to work with the material using the render texture, so i have to disable the event system in the target (render texture camera) scene to avoid conflicts.
Essentially the setup is this:
Main Scene
-Quad (has rendertexture pointing to target scene, i'm doing raycasts on this quad to control things in the target scene)
-event system for UI elemetns in Main scene
Target Scene
- camera rendering to render texture
- canvas with UI elemetns (the ones I want maniuplate
-no eventsystem to avoid conflicts when append loaded to main scene
that help?
yea 1 event system will be shared. Are these both canvases in overlay mode?
are you sure one isnt blocking input for the other?
if you hide one can you interact with the other? are there any layer changes on the event system?
you mean hide the UI canvas in the main scene?