- Home /
Drag And Drop Window
I want to recreate an os ( just for fun ) in unity. Therefore I have a simple calculator window, that I want to be able to drag around. I just have to move one parent object, then it moves all the other stuff with it. How would I do this? Thanks in advance!
Answer by tormentoarmagedoom · May 11, 2018 at 07:06 PM
good day.
You should use the Input functions like Input.GetMouseButton, Input.GetMouseButtonUp
Read the manuals and Api pages and sure you can easy do it !
Bye :D
Yeah, I know that, but I need help calculating the movement...
You dont need to claculate anything, you just need to move the transform.position iof the window.
make the position of the window = position of the mouse
while the button is clicked
Your answer
![](https://koobas.hobune.stream/wayback/20220612162455im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Make an UI elements stays in its parent Area 0 Answers
UI Dropdown Bug 0 Answers
UI Menus,Handling Menus. 1 Answer
Possible to drag items across tabs onto the same frame? 1 Answer
Window prompt not showing when using MSAL .NET library 0 Answers