Hi,
I would like to create a floating window that they player can move around with object that the player can move. The move in the floating window should be replicated on the scene.
Is this possible?
I have been googling but not found anything. Maybe i do a bad search.
My best guess is to use a separate canvas, which i am researching.
I don’t quite understand what you’re trying to do, but I’m confident that it’s possible.
If you want the window to appear in world space, then yes, just attach a separate canvas to the GameObject.
If you want it to appear in screen space, you can make it an element in your main UI canvas. You can still make it follow an object on screen through appropriate ray-casting.
If you want the user to be able to drag this object around, then just attach an EventTrigger to the window frame or title or whatever, and catch the Drag events.
As JoeStrout said it’s tough to tell exactly what you’re asking for. My interpretation is that you want a floating menu kind of like the part menu in Kerbal Space Program. Does that look about right?
Raycasting? Seems like in this case you’d want Camera.WorldToScreenSpace, no?
I would just do all that in the main UI canvas. Have a script on the canvas Image objects that catch the drag events, and move both itself (the Image) and the corresponding scene object. And similarly, have a script on each scene object that moves itself and the corresponding Image item.